通过宝塔面板部署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

猜你喜欢

转载自www.cnblogs.com/zc-mc/p/12662498.html