PHP的file_put_contents功能不工作 [英] php file_put_contents function not working
本文介绍了PHP的file_put_contents功能不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ f = file_put_contents(files / r.js ,这里有些文字);
if($ f)print 1;
else print 0;
解决方案
可能是许可问题
是否将目录 / files
修改为777?有时PHP不会允许你访问目录,如果他们没有足够的权限。尽管我不知道空白错误。尝试查看它是否有足够的权限,如果没有,然后将其设置为777并尝试它。
Why would file_put_contents refuse to work for the following code?
$f = file_put_contents("files/r.js", "Some text here");
if ($f) print 1;
else print 0;
解决方案
It could be a permission problem
Is the directory /files
chmoded to 777? sometimes php won't allow you to access directories if they don't have enough permission. I don't know about blank errors though.
Try to see if it has enough permissions, if not, then set it to 777 and try it.
这篇关于PHP的file_put_contents功能不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文