WordPress - WP 超级缓存无法在 wp-config 上写入

WordPress - WP Super Cache Unable to write on wp-config

将所有 WordPress 权限更改为 777 并将它们分配给 apache:apache 组后,Wp Super Cache 插件仍然无法更改 wp-config.php

不知道为什么!

我的服务器是:

CentOS 7

PHP 71

阿帕奇

MariaDB

Apache 错误日志:

[Thu Nov 02 02:01:45.637165 2017] [php7:warn] [pid 17633] [client 5.202.27.148:25292] PHP Warning:  include(): Failed opening '/var/www/html/wp-content/plugins/wp-super-cachewp-cache-base.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/wp-content/plugins/wp-super-cache/wp-cache.php on line 72, referer: http://website.com/wp-admin/post.php?post=10821&action=edit

WordPress 错误:

Warning! You must set WP_CACHE and WPCACHEHOME in your wp-config.php for this plugin to work correctly: define( 'WP_CACHE', true ); 
define( 'WPCACHEHOME', '/var/www/html/wp-content/plugins/wp-super-cache' );

没错。 wp-config 应该只能由用户手动写入。该文件不应使用代码写入。请将这些配置手动放入您的 wp-config.php.

我的问题是通过禁用阻止 apache 用户编辑文件和文件夹的 SELinux 解决的。