lnmp nginx file_put_contents 失败原因及解决方法

其实有一种更简单的办法,不需要ssh命令。就是用 FlashFXP 登录进去后,右键点击文件或文件夹,选择属性,在底部的文本框中将644修改为777,点击确点就OK~~·

php错误: file_put_contents(xxxx) [function.file-put-contents]: failed to open stream: Permission denied in原因及解决方法

PHP 错误:  file_put_contents(xxxx) [function.file-put-contents]: failed to open stream: Permission denied in

原因:

file_put_contents函数在向指定文件写入数据时权限不足写入失败

解决方法:

修改被写入的文件权限,如果是自动创建的文件,则目录没有权限,需要把目录赋予可写权限

linux下

chmod -R 777 ./dirname 赋予目录可写权限

chmod 777 ./filename 赋予文件可写权限.

windows下

window下需要赋予目录或文件iis权限

全文:https://i.cnblogs.com/EditArticles.aspx?opt=1

posted @ 2017-04-29 11:23  stma  阅读(1726)  评论(0)    收藏  举报