php操作文件提示没有权限怎么办-PHP问题

资源魔 30 0

成绩形容:

正在内陆应用PHP剧本操作文件能够胜利,然而放到效劳器上就没有行。

查看apache日记:

#cd /var/log/httpd
#tac error_log

显示:

cannot create directory '_TEST1': Permission denied

处理办法:

一、查看apache设置装备摆设的用户以及用户组

#vi /etc/httpd/conf/httpd.conf
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User  apache
Group apache

能够看到User以及Group 都是 apache。

二、修正你要操作的文件夹用户以及权限,将用户改成以及apache设置装备摆设同样,将权限修正为755

#chown -R apache:apache your_folder
#chmod -R 755 your_folder

三、封闭SELINUX

#vi /etc/selinux/config
#SELINUX=enforcing #正文掉
#SELINUXTYPE=targeted #正文掉
SELINUX=disabled #添加
:wq! #保留加入
#setenforce 0 #使设置装备摆设立刻失效

更多相干教程请存眷资源魔。

以上就是php操作文件提醒不权限怎样办的具体内容,更多请存眷资源魔其它相干文章!

标签: php php教程 php故障解决 php使用问题 权限

抱歉,评论功能暂时关闭!