Wordpress can't write to file Wordpress can't write to file apache apache

Wordpress can't write to file


I would advise to not change the user Apache is running under (to not edit the Apache config file) but to set apache as the owner of the files. chown -R apache /path/to/your/app/files

I think it's the easiest solution. If you choose to change the permissions, you shouldn't have to change the permissions for everyone (other): you could change to 774 but I don't see why 775.

By default Apache is running under the apache user on CentOS.


This is a very common problem you are facing right now. Some times files/directories created/uploaded with FTP may have been assign a different users/usergroup. As @CĂ©line Aussourd stated, if you have installed plugin from WordPress then all files and directories will get the default user/usergroup.

Now easiest way to identify which user should be assigned to your files is create a single test file using CPanel file manager called "test.php" and access it from web if it is working then check its user/usergroup and change all your setup files to that user/usergroup all together with

chown -R {user} /path/to/your/worpress/root

Replace {user} with apache web user.

UPDATE: (To install plugin without FTP details)

Please add following line to your wp-config.php after define('WP_DEBUG', false); line.

define('FS_METHOD', direct);

Remove plugin and re-install it, this time it wont ask you for FTP details and will write files directly.