Wordpress: unable to write to the wp-config.php file

#1
Hello,

I've just installed the plugin on my site and had to manually alter both the .htaccess and the wp-config file to make yhngs work.

Although I can see I've made the changes I'm still getting the error:

LiteSpeed Cache was unable to write to the wp-config.php file. Please add the following to the wp-config.php file:

define('WP_CACHE', true);

I've tried de-activating and re-activate the plugin several times but the message still keeps popping up.

Is everything working normally or ...
 

Jon K

Administrator
Staff member
#2
This is usually due to a permissions error. Make sure your WordPress files have the correct R/W permissions and make sure they are owned by the right user/group that your PHP runs as.
 
#3
To be clear I've added the necessary code - but the plugin keeps showing the error.

I changed the permissions from 444 to 644 and the error went away. I've since changed permissions back to 444 (for security) and the error has come up again.

The correct code is there so why am I seeing the message still?
 

Jon K

Administrator
Staff member
#4
This seems like it could possibly be a bug, with talking with our WP Plugin developer he advised me to as you to do the following.

With 444 permisisons add the following line to wp-config.php either below or above define('WP_CACHE', true);
error_log('test include');

Then try loading the admin panel and see if an error log is generated in wp-admin/ folder.

Let me know your results!
 
#5
Hi,

OK so with the permissions still set at 444 here's an extract from the log:

[01-Mar-2017 15:26:48 UTC] wp-config file not writeable for 'WP_CACHE'
[01-Mar-2017 15:27:58 UTC] wp-config file not writeable for 'WP_CACHE'
[01-Mar-2017 15:28:49 UTC] wp-config file not writeable for 'WP_CACHE'
[01-Mar-2017 15:29:51 UTC] wp-config file not writeable for 'WP_CACHE'
[01-Mar-2017 15:33:51 UTC] wp-config file not writeable for 'WP_CACHE'
[01-Mar-2017 15:36:12 UTC] wp-config file not writeable for 'WP_CACHE'
[01-Mar-2017 15:37:54 UTC] wp-config file not writeable for 'WP_CACHE'
[01-Mar-2017 15:38:38 UTC] wp-config file not writeable for 'WP_CACHE'
[01-Mar-2017 15:38:41 UTC] test include
[01-Mar-2017 15:38:55 UTC] wp-config file not writeable for 'WP_CACHE'
[01-Mar-2017 15:38:59 UTC] test include
 

KevinFwu

Administrator
Staff member
#6
Hi Mary,

I'm not entirely sure why you are still receiving that message.

The wp-config.php file is included by WordPress (which triggers the message), but that should have defined WP_CACHE to true at the same time.

The 644 permissions probably worked because if the define is not detected, we try to write to the file, which triggers the success.

One possibility is a memory or op code cache. Could you clear that cache and see if it re-loads the define as true?

If that doesn't work, could you pm us ssh information so we can see what's going on with the files?

Thanks,
Kevin
 
#7
Hi

Could you confirm which cache you want clearing? The Litespeed cache or server cache? Soz a bit newbie to all this
 

KevinFwu

Administrator
Staff member
#8
I'm referring to an in memory cache - memcache, redis, zen, etc.

If you didn't set one up, it might not be a thing to worry about.

I was concerned about an opcode cache because they may have cached a define FALSE.

If you don't have one, could you give us temporary login access?

Thanks,
Kevin
 
#9
Hi,

Yup they mean nothing to me :)

I've just tried to copy in admin details for the hosting (I asusme that is right) but it won't let me send the details. Get an error message about spam
 
Top