简体   繁体   English

file_put_contents无法打开流:权限被拒绝

[英]file_put_contents failed to open stream: Permission denied

Basic php and javascript website No errors on Wamp When I put the files on my Lamp server everything works except for this error I get on the top of the page 基本的php和javascript网站Wamp上没有错误当我把文件放在我的Lamp服务器上时一切正常但除了这个错误我得到了页面的顶部

Warning: file_put_contents(donneesDonut.json): failed to open stream: Permission denied in /var/www/html/bp/action/IndexAction.php on line 101 警告:file_put_contents(donneesDonut.json):无法打开流:101行/var/www/html/bp/action/IndexAction.php中的权限被拒绝

I looked around and most people suggest to change the permission of the file or the entire directory on apache. 我环顾四周,大多数人建议在apache上更改文件或整个目录的权限。 chmod 777 did nothing for me. chmod 777对我没有任何作用。

I'm new to web servers so I probably have missed some apache configuration for permissions during the installation process 我是Web服务器的新手,所以我可能在安装过​​程中错过了一些apache配置的权限

Here is a screenshot of the directory Directory listing 以下是目录列表的屏幕截图

I don't think there is a problem with the code since it works on my local Wamp server but here is the line of code that gives me the error. 我不认为代码有问题,因为它可以在我的本地Wamp服务器上运行,但这里是给我错误的代码行。

file_put_contents($this->json, json_encode($this->donneesDonut));

If you need any other information like specific apache configuration please tell me where to get them. 如果您需要任何其他信息,如特定的apache配置,请告诉我从哪里获取它们。

Hope you can help 希望你能帮忙

问题是SELinux默认设置为在Centos上强制执行

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 file_put_contents - 无法打开流:权限被拒绝 - file_put_contents - failed to open stream: Permission denied file_put_contents无法打开流:权限被拒绝 - file_put_contents failed to open stream: Permission denied Codeigniter file_put_contents:未能打开 stream:权限被拒绝 - Codeigniter file_put_contents: failed to open stream: Permission denied 警告:file_put_contents():无法打开流:权限被拒绝 - Warning: file_put_contents(): failed to open stream: Permission denied file_put_contents(文件路径/文件)[function.file-put-contents]:无法打开流:权限被拒绝 - file_put_contents(filepath/file) [function.file-put-contents]: failed to open stream: Permission denied Google 云端硬盘:file_put_contents(token.json):无法打开流:权限被拒绝 - Google Drive: file_put_contents(token.json): failed to open stream: Permission denied file_put_contents()::无法打开流:权限被拒绝,调整CODEIGNITER的大小 - file_put_contents():: failed to open stream: Permission denied, resize CODEIGNITER Laravel Forge:file_put_contents():无法打开流:权限被拒绝 - Laravel Forge: file_put_contents(): failed to open stream: Permission denied Laravel-file_put_contents()-打开stream失败,权限被拒绝 - Laravel- file_put_contents()-failed to open stream, permission denied file_put_contents(meta/services.json):无法打开 stream:权限被拒绝 - file_put_contents(meta/services.json): failed to open stream: Permission denied
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM