https://www.cnblogs.com/gyfluck/p/10019784.html

 

发生情境:

使用Composer安装Laravel5.1版本到本地wamp环境,可以成功访问框架首页,
然后上传到服务器上,报500错误。

 

 

解决:

(1)在首页public/index.php,echo 1;exit();

可以正常访问首页,表示域名是可以访问到项目的。
(2)查看nginx错误日志:

[error] 15789#0: *19384 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught 
exception 'UnexpectedValueException' with message 'The stream or file 
".../laravel/storage/logs/laravel.log" could not be opened: failed to open 
stream: Permission denied' in 
.../laravel/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107

不能打开storage/logs/laravel.log,查看文件权限,发现没有这个文件,

然后创建这个文件,并赋予读写执行权限。
再次访问,发现错误变化了:
/storage/framework/views权限有问题,修改权限,访问首页正常了。

 

相关文章:

  • 2021-09-20
  • 2021-04-03
  • 2021-08-03
  • 2021-05-30
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2021-10-10
  • 2022-01-08
  • 2021-12-22
相关资源
相似解决方案