file_put_contents () failed to open stream: Permission denied 解决办法
今天,帮朋友配置服务器thinkphp5的时候,直接访问“www.***.com/admin/index/index” ;
出现以下错误:
- file_put_contents (/PHP/admin/tp/runtime/temp/71dafaa2a0ea0d586666de9d67f301a7.php) failed to open stream: Permission denied
翻译:
- file_put_contents(/PHP/admin/tp/runtime/temp/71dafaa2a0ea0d586666de9d67f301a7.php):无法打开流:权限被拒绝
解决办法:
如果你用TP的时间比较长,或者说你比较了解TP的人都会知道,TP的runtime它需要的权限是很大的,如果你只给一般权限肯定是不行的,通常都是给runtime权限:777;
linux命令如下:
cd /PHP/admin/tp/
chmod -R 777 runtime
注意:只要大家以后遇到 “file_put_contents 无法打开流:权限被拒绝 ”,只需要给权限就可以了。windos基本上不会遇到这个问题,但是linux遇到的就很多了。
=============补充============================
我出错是应为将laravel本地的缓存文件通过git用户上传到了服务器,服务器的用户是www,导致www没有权限

file_put_contents () failed to open stream: Permission denied 解决办法的更多相关文章
- file_put_contents() failed to open stream: Permission denied 问题解决
很长时间没有写PHP了,今天突然有个需求要写一个保存文件的功能. function downloadFile( $url , $savePath = '' ) { $fileName = ge ...
- docker 错误failed to open stream: Permission denied 解决方法
在服务器上面.运行docker时,php目录会发生权限问题解决方法如下: 1:进入php目录下面 docker exec -ti php56 /bin/bash #进入php容器 chown -R w ...
- laravel he stream or file "..laravel-2019-02-14.log" could not be opened: failed to open stream: Permission denied
错误:The stream or file "/var/www/jianshu/storage/logs/laravel-2019-02-14.log" could not be ...
- Warning: file_put_contents(data.txt): failed to open stream: Permission denied in /Library/WebServer/Documents/test.php on line 22
最近在学习PHP 在保存文件的时候报Warning: file_put_contents(data.txt): failed to open stream: Permission denied in ...
- php上传文件时出现错误:failed to open stream: Permission denied
尝试使用php写了一段小的上传程序,但是在使用的时候,在上传文件时出现这个错误,由于之前在写程序要读文件,曾经出现过这个问题,当时是因为要读的文件的权限不够,于是使用chmod 775 1.txt把文 ...
- [置顶] PHP调用move_uploaded_file()提示 failed to open stream: Permission denied(Linxux环境,以Ubuntu12.04为例)
在使用PHP上传文件之后,我们有时候还需要移动到特定的文件夹,这时候就要调用move_uploaded_file()函数,可是会出现如下错误: Warning: move_uploaded_file( ...
- easyhadoop:failed to open stream:Permission denied in /var/www/html/index.php
今天又重新部署了下easyhadoop,结果apache后台服务器报这个错误: [Fri Dec 13 10:32:41 2013] [notice] SIGHUP received. Attempt ...
- failed to open stream: Permission denied in警告错误
问题是文件所在目录的权限问题导致的.只需要将警告文件所在的目录权限更改为777(至少是006)即可 例如 (...a.log)failed to open stream: Permission den ...
- nginx的权限问题(Permission denied)解决办法
nginx的权限问题(Permission denied)解决办法 一个nginx带多个tomcat集群环境,老是报如下错误:failed (13: Permission denied) while ...
随机推荐
- [转]免费数学神器!再复杂的公式,只要有照片就能转成LaTeX
转自:https://mp.weixin.qq.com/s/ja7UGr742DtYglGU6TT4qg 又一数学神器来袭! 这是一个帮你快速把数学公式图片转成LaTeX代码的工具,名为Snip,可以 ...
- YAML学习
YAML学习 一:什么是YAML?YAML是专门用来写配置文件的语言,通过它来编写完成后,我们可以通过插件JS-YAML(https://github.com/nodeca/js-yaml)来转换成我 ...
- Ansible安装及配置
ansible分为以下几个部份: Ansible:核心引擎 Modules:包括 Ansible 自带的核心模块(core modules)及自定义模块 (custom modules): 核心模块: ...
- ASP.NET 加密解密
1.MD5 2.DES 一 MD5 介绍:MD5是不可逆解密方式,比如对密码的加密,为了保密,让密码不能解密 public static string MD5Encrypt(string str) { ...
- 用kubernetes部署oa 强制删除pod delete
1.[root@pserver88 oa]# cat Dockerfile FROM tomcat RUN rm -rf /usr/local/tomcat/webapps/*ADD ROOT.war ...
- 5-(基础入门篇)学会刷Wi-Fi模块固件(刷LUA版本固件)
http://www.cnblogs.com/yangfengwu/p/9065559.html 基础教程源码链接请在淘宝介绍中下载,由于链接很容易失效,如果失效请联系卖家,谢谢 https://it ...
- 创建Web API并使用
昨晚有教一个网友在ASP.NET MVC里,创建Web API和在MVC视图中应用此API. 可以在ASP.NET MVC中,创建程序的model: namespace Insus.NET.Model ...
- 设计模式:装饰模式(decorate)
还是那几句话: 学无止境,精益求精 十年河东,十年河西,莫欺少年穷 学历代表你的过去,能力代表你的现在,学习代表你的将来 废话不多说,直接进入正题: 今天学习了装饰模式,但是代码看不太懂,于是我将装饰 ...
- [Oracle]如何获得出现故障时,客户端的详细连接信息
[Oracle]如何获得出现故障时,客户端的详细连接信息 客户坚持说 只是在 每天早上5点才运行下面的语句: select / * + FULL (TAB001_TT01) * / 'TAB001_T ...
- ElasticSearch5.5.1插件分类
ElasticSearch5.5.1插件分类 附官网介绍:https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/intro.html 一. ...