2017-06-13 135 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/

相關問題