我正面临着centos 7服务器中的下一个错误
我看一下类似的问题,因为SELinux不允许httpd写入我的/ home文件夹,我试过更改文件夹的所有者但没有成功;尝试将上下文(chcon)更改为my / home的httpd_sys_rw_content_t
,但错误相同;尝试禁用SELinux并且错误仍然存在;并在文件httpd.conf
将User
和Group
从apache
改为test
这也没有用。我的服务器是:
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.4.1708 (Core)
Release: 7.4.1708
Codename: Core
和
Linux localhost 3.10.0-693.17.1.el7.x86_64 #1 SMP Thu Jan 25 20:13:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
当我从move_uploaded_file()
执行php -a
作为用户test
它正常工作,我看到问题是与用户apache
经过几个小时的调试后,解决方案非常简单:
setenforce 0
并重新启动httpd服务