2017-06-13 75 views
0

我环顾四周,大部分答案都不是共享主机,这恰好是我的情况。Laravel未能打开流:权限被拒绝

我已经完成chmodstoragebootstrap/cache/775。我也有一个storage/framework/views目录,我也试过删除storage/logs/laravel.log

N.B该脚本在我以前的共享主机方案上运行良好,只有file_get_contents的页面似乎成了问题。

有问题的文件是ErrorExceptionPostController.php line 17:我正在使用file_get_contents调用。

+0

哪个文件被拒绝的权限?通常这个错误包括文件路径。 – Devon

+0

它在这里在PostController.php 17行错误: –

+0

我会想象'file_get_contents'被禁用您的共享主机提供商。相关:https://stackoverflow.com/questions/4656102/equivalent-function-for-file-get-contents – Scopey

回答

0

尝试运行PHP的工匠配置:缓存那么PHP工匠ENV

0

我想你已经设置了错误的权限。为bootstrap \ cache和storage目录提供777个权限而不是775个。请看看here.

0

在CentOS 7 + Apache的:

cd /var/www/laravelfolder 
sudo chown apache:apache -R /var/www/laravelfolder 
find . -type f -exec chmod 0644 {} \; 
find . -type d -exec chmod 0755 {} \; 
sudo chcon -t httpd_sys_content_t /var/www/laravelfolder -R 
sudo chcon -t httpd_sys_rw_content_t /var/www/laravelfolder/storage -R 
sudo chcon -t httpd_sys_rw_content_t /var/www/laravelfolder/bootstrap/cache -R 

来源:https://blog.lysender.com/2015/07/centos-7-selinux-php-apache-cannot-writeaccess-file-no-matter-what/

相关问题