Localhost is currently unable to handle this request. http error 500 laravel 8

I know that there is some 500 Internal Server Error when is see this page,

The localhost page isn’t working localhost is currently unable to handle this request. HTTP ERROR 500

I have already set the variables display_errors: On and error_reporting : E_ALL in my php.ini config file and restarted the server.

I still see the same page and not the actual error message that is causing the Internal Server Error. Why?

Solution

Based upon the information you’ve provided, a permissions issue on the file (or files) would be one cause of the same 500 Internal Server Error.

To check whether this is the problem (if you can’t get more detailed information on the error), navigate to the directory in Terminal and run the following command:

ls -la

If you see limited permissions – e.g. -rw-------@ against your file, then that’s your problem.

The solution then is to run chmod 644 on the problem file(s) or chmod 755 on the directories. See this answer – How do I set chmod for a folder and all of its subfolders and files? – for a detailed explanation of how to change permissions.

By way of background, I had precisely the same problem as you did on some files that I had copied over from another Mac via Google Drive, which transfer had stripped most of the permissions from the files.

The screenshot below illustrates. The index.php file with the -rw-------@ permissions generates a 500 Internal Server Error, while the index_finstuff.php (precisely the same content!) with -rw-r--r--@ permissions is fine. Changing the permissions on the index.php immediately resolves the problem.

In other words, your PHP code and the server may both be fine. However, the limited read permissions on the file may be forbidding the server from displaying the content, causing the 500 Internal Server Error message to be displayed instead.

Localhost is currently unable to handle this request. http error 500 laravel 8

I was using CakePHP and I was seeing this error:

This page isn’t working localhost is currently unable to handle this request. HTTP ERROR 500

I went to see the CakePHP Debug Level defined at app\config\core.php:

/** * CakePHP Debug Level: * * Production Mode: * 0: No error messages, errors, or warnings shown. Flash messages redirect. * * Development Mode: * 1: Errors and warnings shown, model caches refreshed, flash messages halted. * 2: As in 1, but also with full debug messages and SQL output. * 3: As in 2, but also with full controller dump. * * In production mode, flash messages redirect after a time interval. * In development mode, you need to click the flash message to continue. */ Configure::write('debug', 0);

I chanted the value from 0 to 1:

Configure::write('debug', 1);

After this change, when trying to reload the page again, I saw the corresponding error:

Fatal error: Uncaught Exception: Facebook needs the CURL PHP extension.

Conclusion: The solution in my case to see the errors was to change the Cake PHP Debug Level from 0 to 1 in order to show errors and warnings.

If you are using the codeigniter framework and are testing the project on a localhost, open the main Index.php file of your project folder and find this code:

define('ENVIRONMENT', 'production');

Change it to

define ('ENVIRONMENT', 'development');

Because same this ENVIRONMENT is in your database.php file under config folder. like this:

'db_debug' => (ENVIRONMENT! == 'development')

So the environment should be the same in both places and problem will be solved.

Answer

So, eventually I did that thing that all developers hate doing. I went and checked the server log files and found a report of a syntax error in line n.

tail -n 20 /var/log/apache2/error.log

Such kind of error normally happens when you try using functions like php_info() wrongly.

<?php php_info(); // 500 error phpinfo(); // Works correctly ?>

A close look at your code will be better.

First of all check error log in the path that your webserver indicates. Then maybe the browser is showing friendly error messages, so disable it.

https://superuser.com/questions/202244/show-http-error-details-in-google-chrome

It maybe solve your problem, check your files access level

$ sudo chmod -R 777 /"your files location"

The problem is with the Php code because other pages of the same website load properly. I see this error only on one URL and i know that there is some problem with the php code. what i want to know is why it dosen’t is display a fatal error message

Questions : laravel 5.5 HTTP ERROR 500 unable to handle this request

2022-08-05T05:15:54+00:00 2022-08-05T05:15:54+00:00

603

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

Total Answers 6

25

Answers 1 : of laravel 5.5 HTTP ERROR 500 unable to handle this request

I hope, You already do this.

  • You should change those public facing permissions to 644.
  • Change the Storage folder 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:clear after any changes to .env.

0

2022-08-05T05:15:54+00:00 2022-08-05T05:15:54+00:00Answer Link

mRahman

6

Answers 2 : of laravel 5.5 HTTP ERROR 500 unable to handle this request

For Laravel 5.5 you need following anycodings_php server requirement

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

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

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

0

2022-08-05T05:15:54+00:00 2022-08-05T05:15:54+00:00Answer Link

jidam

6

Answers 3 : of laravel 5.5 HTTP ERROR 500 unable to handle this request

I had the same issue on Laravel 8, turns anycodings_php out the problem arose from interrupting anycodings_php a composer update process.

If you are in the same situation, just anycodings_php run composer update, that should fix it.

0

2022-08-05T05:15:54+00:00 2022-08-05T05:15:54+00:00Answer Link

jidam

2

Answers 4 : of laravel 5.5 HTTP ERROR 500 unable to handle this request

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

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

/etc/php/php.ini

switch display error to on

display_errors = On

and

display_startup_errors = On

then restart apache server

sudo systemctl server restarting httpd

then information about the error will anycodings_php appear in your browser

0

2022-08-05T05:15:54+00:00 2022-08-05T05:15:54+00:00Answer Link

jidam

6

Answers 5 : of laravel 5.5 HTTP ERROR 500 unable to handle this request

I faced this problem too many times, the anycodings_php solution was to run #composer install anycodings_php and/or #composer update to update the anycodings_php composer dependencies packages, or you anycodings_php might even lost the .htaccess file anycodings_php during moving/copying the files in the anycodings_php live server

0

2022-08-05T05:15:54+00:00 2022-08-05T05:15:54+00:00Answer Link

jidam

6

Answers 6 : of laravel 5.5 HTTP ERROR 500 unable to handle this request

For Laravel 8 in docker, you might want anycodings_php to change the permission of your storage anycodings_php folder.

sudo chmod -R 777 storage

0

2022-08-05T05:15:54+00:00 2022-08-05T05:15:54+00:00Answer Link

jidam