php laravel 5.5 HTTP ERROR 500 无法处理这个请求

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46639518/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 03:14:28  来源:igfitidea点击:

laravel 5.5 HTTP ERROR 500 unable to handle this request

phplaravel-5laravel-5.5

提问by patipat chewprecha

My old Project use Laravel 5.4.17 It can work in server normally.But new Project use Laravel 5.5.4 It can't work when route in root/public " mydomain.com/root/public is currently unable to handle this request. HTTP ERROR 500". Is it a problem with the version of php? Because current php version is 5.6.23. Laravel 5.5 require php 7.0? Do you think I'm right?

我的旧项目使用 Laravel 5.4.17 可以在服务器正常工作。但是新项目使用 Laravel 5.5.4 无法在 root/public 中路由时无法工作“ mydomain.com/root/public 目前无法处理此请求。 HTTP 错误 500”。是不是php版本的问题?因为当前的 php 版本是 5.6.23。Laravel 5.5 需要 php 7.0?你觉得我说得对吗?

回答by iCoders

For Laravel 5.5 you need following server requirement

对于 Laravel 5.5,您需要以下服务器要求

The Laravel framework has a few system requirements. Of course, all of these requirements are satisfied by the Laravel Homestead virtual machine, so it's highly recommended that you use Homestead as your local Laravel development environment.

Laravel 框架有一些系统要求。当然,所有这些要求 Laravel Homestead 虚拟机都满足,所以强烈建议您使用 Homestead 作为您本地的 Laravel 开发环境。

However, if you are not using Homestead, you will need to make sure your server meets the following requirements:

但是,如果您不使用 Homestead,则需要确保您的服务器满足以下要求:

PHP >= 7.0.0
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension

Ref: https://laravel.com/docs/5.5#server-requirements

参考:https: //laravel.com/docs/5.5#server-requirements

回答by Ajai

I hope, You already do this.

我希望,你已经这样做了。

  • You should change those public facing permissions to 644.
  • Change the Storagefolder permission to 777.
  • Check the logs.
  • Make sure you configured nginx properly and then restart nginx.
  • Should you be sure the APP_KEY is in the .env file.
  • You should run php artisan config:clearafter any changes to .env.
  • 您应该将这些面向公众的权限更改为 644。
  • 存储文件夹权限更改为 777。
  • 检查日志。
  • 确保您正确配置了 nginx,然后重新启动 nginx。
  • 您是否应该确定 APP_KEY 在 .env 文件中。
  • 您应该php artisan config:clear在对 .env 进行任何更改后运行。

回答by Teguh Siswanto

I use Manjaro Linux. I installed Apache, MySQL, Php, PhpMyAdmin separately (not using lampp)

我使用 Manjaro Linux。我分别安装了Apache、MySQL、Php、PhpMyAdmin(不使用lampp)

this issue "localhost is currently unable to handle this request" appears because we have to enable display_error in the php configuration located at

出现这个问题“本地主机当前无法处理此请求”是因为我们必须在位于的 php 配置中启用 display_error

/etc/php/php.ini

/etc/php/php.ini

switch display error to on

将显示错误切换为开

display_errors = On 

and

display_startup_errors = On

then restart apache server

然后重启apache服务器

sudo systemctl server restarting httpd

then information about the error will appear in your browser

然后有关错误的信息将出现在您的浏览器中