当前位置: 代码迷 >> PHP >> 服务器上file_put_contents写入文件失败解决方法
  详细解决方案

服务器上file_put_contents写入文件失败解决方法

热度:26   发布时间:2016-04-28 19:52:55.0
服务器上file_put_contents写入文件失败

写入的文件为


-rwxr-xr-x. 1 root root 15061 Feb 21 00:07 student.css


语句为


$cont = str_replace('/Public/Images', __APP__ . '/Public/Images', $content);
echo $cont;  // 此为修改过后的内容
var_dump(file_put_contents($dv, $cont)); // 返回bool(false)
exit;


这是咋回事???
------解决方案--------------------
你不是看到没有权限了吗?
------解决方案--------------------
你是root用户吗?其他用户是没有写的权限的
------解决方案--------------------
chmod 777 path
  相关解决方案