我有一台装有Fedora的电脑,当我启动一个httpd服务时,我尝试打开一个我使用简单file_put_contents
的页面,它说我没有足够的权限来做到这一点。所以我将文件夹的权限更改为777,但它仍然无效。
同样的事情发生在用laravel制作的项目中。当我在公共文件夹中打开index.php时,它说不能在services.json中执行file_put_content
有谁知道为什么?
最后10行错误日志:
[pid 12387] [client 127.0.0.1:50884] PHP Warning: file_put_contents(/var/www/html/file.txt): failed to open stream: Permission denied in /var/www/html/info.php on line 2
[Fri Jun 05 12:01:48.351406 2015] [mpm_prefork:notice] [pid 12385] AH00170: caught SIGWINCH, shutting down gracefully
[Fri Jun 05 12:01:49.438875 2015] [core:notice] [pid 13460] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Fri Jun 05 12:01:49.439637 2015] [suexec:notice] [pid 13460] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Jun 05 12:01:49.463336 2015] [auth_digest:notice] [pid 13460] AH01757: generating secret for digest authentication ...
[Fri Jun 05 12:01:49.464443 2015] [lbmethod_heartbeat:notice] [pid 13460] AH02282: No slotmem from mod_heartmonitor
[Fri Jun 05 12:01:49.482226 2015] [mpm_prefork:notice] [pid 13460] AH00163: Apache/2.4.12 (Fedora) PHP/5.6.9 configured -- resuming normal operations
[Fri Jun 05 12:01:49.482278 2015] [core:notice] [pid 13460] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Fri Jun 05 12:02:00.599063 2015] [:error] [pid 13462] [client 127.0.0.1:50902] PHP Warning: file_put_contents(/var/www/html/file.txt): failed to open stream: Permission denied in /var/www/html/info.php on line 2
[Fri Jun 05 12:02:01.589609 2015] [:error] [pid 13462] [client 127.0.0.1:50902] PHP Warning: file_put_contents(/var/www/html/file.txt): failed to open stream: Permission denied in /var/www/html/info.php on line 2