寶塔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
