Possible Duplicate:
file_put_contents permission deniedfile_put_contents表示权限被拒绝?
我最近转移了服务器,似乎file_put_contents不在新服务器上工作。
一切都一样,这些文件夹被正确地chmodded,但由于某些原因,它不创建文件并将其中的内容。
我创建了一个测试以供您查看,模仿我们目前如何做:
file_put_contents("/home/user/public_html/test/test.progress", "test");
脚本正在运行在
/home/user/public_html/test.php
/test folder is chmodded to 755 (777 makes no difference)
我收到以下错误:
Warning: file_put_contents(/home/user/public_html/test/test.progress) [function.file-put-contents]: failed to open stream: Permission denied in /home/user/public_html/test.php on line 2
是否需要更改服务器上的任何设置才能使用?哪里不对?
需要更多关于环境的信息。 – 2011-05-13 09:38:18
服务器正在运行不同于该文件夹/测试的创建者的用户 – konsolenfreddy 2011-05-13 09:39:10
Cent OS,linux,服务器版本:Apache/2.0.63(Unix)mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 PHP/5.3.6 – Latox 2011-05-13 09:39:32