将php56w从5.6.31更新到5.6.35后Wordpress文件权限中断
上周五,我将Wordpress博客的php安装从PHP5.6.31更新为PHP5.6.35。博客使用FastCGI和Apache提供流量服务,服务器运行的是CentOS 7。升级后,Wordpress文件权限似乎被破坏。我无法将文件上传到博客条目、更新插件或更新Wordpress本身 起初,试图升级Wordpress时,提示我输入FTP凭据,这是我过去从未使用过的。所以我添加了将php56w从5.6.31更新到5.6.35后Wordpress文件权限中断,php,wordpress,apache,fastcgi,Php,Wordpress,Apache,Fastcgi,上周五,我将Wordpress博客的php安装从PHP5.6.31更新为PHP5.6.35。博客使用FastCGI和Apache提供流量服务,服务器运行的是CentOS 7。升级后,Wordpress文件权限似乎被破坏。我无法将文件上传到博客条目、更新插件或更新Wordpress本身 起初,试图升级Wordpress时,提示我输入FTP凭据,这是我过去从未使用过的。所以我添加了define('FS_METHOD','direct')到我的wp-config.php。这取得了进展,但我得到的错误暗
define('FS_METHOD','direct')代码>到我的wp-config.php。这取得了进展,但我得到的错误暗示了文件权限问题,尽管据我所知,它们是正确的
wordpress的所有文件都位于/var/www/html
中,该文件归apache:apache
所有。文件大部分是0644,文件夹大部分是0755,更新后没有任何更改。httpd和php-fpm都以apache的形式运行。尝试更新wordpress本身会显示:
Downloading update from https://downloads.wordpress.org/release/wordpress-4.9.5-no-content.zip…
Unpacking the update…
Warning: copy(/var/www/html/wp-admin/includes/update-core.php): failed to open stream: Permission denied in /var/www/html/wp-admin/includes/class-wp-filesystem-direct.php on line 243
The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php
Installation Failed
我想知道php升级是否改变了php配置,从而破坏了php访问博客的方式。它看起来不像是一个文件权限的东西,尽管每个错误都表明它是。例如,我可以sudo-uapachetouch/var/www/html/wp admin/includes/test
很好
这就是我的/etc/httpd/conf.d/php.conf
的样子:
# Cause the PHP interpreter to handle files with a .php extension.
#
<FilesMatch \.php$>
SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>
#AddHandler php5-script .php
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps
#
# Apache specific PHP configuration options
# those can be override in each configured vhost
#
php_value session.save_handler "files"
php_value session.save_path "/var/lib/php/session"
#php_value soap.wsdl_cache_dir "/var/lib/php/wsdlcache"
如果这实际上是由php升级引起的配置更改引起的,那么有人知道如何解决这个问题吗?不幸的是,yum-history-undo[x]对我不起作用,因此我想我可能需要通过艰难的方式来解决这个问题
感谢您提供的帮助。问题是由SELinux引起的。sudo setenforce permissive修复了该问题,因此我需要修复策略
Updated php56w-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-bcmath-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-cli-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-common-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-dba-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-devel-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-fpm-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-gd-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-intl-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-mbstring-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-mcrypt-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-opcache-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-pdo-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-process-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-soap-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic
Updated php56w-xml-5.6.31-1.w7.x86_64 @webtatic
Update 5.6.35-1.w7.x86_64 @webtatic