-1

我的 Apache 用户有问题。他似乎对linux系统没有任何权利。我使用 CentOS 7、Apache 2.4.6、PHP 5.5.21。apache 用户是 apache:apache 当我尝试使用chmod()fopen()我得到“权限被拒绝”所以我创建了一个名为 info.php 的文件:

-rwxrwxrwx.  1 apache apache   50 Jan 30 13:55 info.php

在这个文件中,我刚刚添加了这一行:

<?php chmod("info.php", 777); ?>

结果是:

Warning: chmod(): Permission denied in /var/www/html/info.php on line 1

所以我认为问题是,系统用户 Apache 没有权限,但我不知道如何解决这个问题?

谢谢。

编辑:修复 php 代码

4

1 回答 1

0

You are calling the chmod with wrong parameter.

chmod("filename", 0777);

Please refer to the PHP manual http://php.net/manual/en/function.chmod.php

于 2015-01-30T14:50:47.110 回答