0

I can't workout how to solve this problem so wordpress would let me upload themes.

I have a fresh copy of Fedora 17 installed on my dev machine.

I then installed mysql using: yum install mysql mysql-server. Next I installed WordPress which also installs apache and php: yum install wordpress

I can go to http://localhost/wordpress and see WordPress working. But when I try tried to install my theme it asked for ftp credentials. I then updated the wp-config.php file and set the FS_METHOD constant to direct. Now it doesn't ask for ftp credentials but it gives me this error:

Could not create directory. /usr/share/wordpress/wp-content/themes/my-theme-name/

httpd service is running under 'apache' user and 'apache' group. The /usr/share/wordpress/ directory is recursively own by 'apache' user and 'apache' group too. I've even set the permissions to 777 (also recursively) and even then I keep getting the same error as above.

How can I solve this problem?

1
  • Check the user used by wordpress in the wpconfig , i had the same issue on my server, the process was running under a user but wordpress was using another user.
    – user1409909
    Sep 20, 2012 at 7:20

2 Answers 2

2

Fedoras SELinux configuration is most probably blocking the attempts of the webserver to write to the disk. To change the settings for your wordpress folder you can run this command (as root):

chcon -R -t httpd_sys_content_rw_t /usr/share/wordpress/wp-content

No need to do chmod 777 to the whole folder, this is a huge security risk. Of course this is for direct filesystem access, you have to disable the ftp access. For ftp access you will have to look up the right SELinux context.

2
1

You got the check these lines in your Wp-config.php (aproximatively line 105) :

define('FTP_USER', 'usr');
define('FTP_PASS', 'P@ssw0rd');
define('FTP_HOST', 'url');

You process of web server is running on apache but Wordpress will use the account define in the wp-config.php . So you got to set the group of your user to get access to these files.

Setting permissions 777 is not a solution, you got to care about it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.