通過寶塔面板部署Laravel項目遇到的問題


寶塔lnmp安裝laravel報錯500

1、當響應500無錯誤信息時,查看php.ini中display_errors是否為On

2、當出現如下錯誤,則是因為開啟了防跨站攻擊(open_basedir)配置

Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/lexianghui/bootstrap/autoload.php) is not within the allowed path(s):
 (/home/wwwroot/lexianghui/public/:/tmp/:/proc/) in /home/wwwroot/lexianghui/public/index.php on line 22

Warning: require(/home/wwwroot/lexianghui/bootstrap/autoload.php): failed to open stream: Operation not permitted in
 /home/wwwroot/lexianghui/public/index.php on line 22
Fatal error: require(): Failed opening required '/home/wwwroot/lexianghui/public/../bootstrap/autoload.php' 
(include_path='.:/usr/local/php/lib/php') in /home/wwwroot/lexianghui/public/index.php on line 22

  解決方法:關閉寶塔面板->網站->站點修改->網站目錄選項卡中的防跨站攻擊(如需開啟改配置則另行百度)

 

 

 3、出現Laravel框架如下報錯時,是因為php.ini中disable_functions設置中禁用了putenv,將其從禁用方法集合中移除即可

 

4、仍響應500的話檢查下storage目錄是否有寫權限,沒有的話改成777

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM