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