chown apache:apache -R /home/pclib/www/wordpress
chcon -t httpd_sys_content_t /home/pclib/www/wordpress -R
chcon -t httpd_sys_rw_content_t /home/pclib/www/wordpress/wp-content/* -R
CentOS 7.X Wrodpress 上傳的檔案無法被移動至wp-content/uploads/
wp-config.php
/** 設定 WordPress 變數和包含的檔案。 */
require_once(ABSPATH . ‘wp-settings.php’);
define(‘FS_METHOD’,’direct’);
define(‘FTP_BASE’, ‘/www/’);
define(‘FTP_CONTENT_DIR’, ‘/www/wordpress/wp-content/’);
define(‘FTP_PLUGIN_DIR’, ‘/www/wordpress/wp-content/plugins/’);
define(‘FTP_THEMES_DIR ‘, ‘/www/wordpress/wp-content/themes/’);
/** Override default file permissions */
if(is_admin()) {
add_filter(‘filesystem_method’, create_function(‘$a’, ‘return “direct”;’ ));
define( ‘FS_CHMOD_DIR’, 0751 );
}
[root@ms wordpress]# chcon -t httpd_sys_rw_content_t /home/shulilai/www/wordpress/wp-admin/* -R
[root@ms wordpress]# chcon -t httpd_sys_rw_content_t /home/shulilai/www/wordpress/wp-includes/* -R
The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-signup.php, wp-config-sample.php, wp-login.php, wp-settings.php, wp-activate.php, wp-comments-post.php
[root@ms wordpress]# chcon -t httpd_sys_rw_content_t /home/shulilai/www/wordpress/*