문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top