shariff's avatar
Level 51

127.0.0.1 is currently unable to handle this request (HTTP ERROR 500)

Hi

I just downloaded a laravel project from github and follow the installation guide. Some modules works fine and in some modules I'm getting the below response from the server.

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

I'm not getting any error. laravel.log file is not updating.

I tried so many things but nothing is working. I'm not able to see any errors as well

php artisan config:cache
php artisan optimize 
composer dump-autoload

APP_ENV=local
APP_DEBUG=true

Not understanding where is the problem.

0 likes
12 replies
tisuchi's avatar

@shariff Make sure:

  1. You have vendor folders
  2. Make sure you have .env file
3 likes
shariff's avatar
Level 51

@tisuchi Yes everything is there.

Most of the functionality is working fine. Only on few functionality it is showing like that.

This page isn’t working
127.0.0.1 is currently unable to handle this request.
HTTP ERROR 500
2 likes
tisuchi's avatar

@shariff If you have 500 error, you should see some error log in the laravel.log file.

Make sure you have the following set in the .env file:

LOG_CHANNEL=stack
3 likes
shariff's avatar
Level 51

@tisuchi laravel.log file is not getting added or updated. Not able to find the issue as well

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
2 likes
tisuchi's avatar

@shariff hmm!

Is your storage/logs directory writable?

And can you try to clear your cache also?

php artisan cache:clear
3 likes
shariff's avatar
Level 51

@tisuchi Yes. I tried clearing cache. I tried deleted composer.lock and reinstalling all the packages.

But no luck

1 like
Tharshini_95's avatar

@shariff try running php artisan serve and see if the issue persists. If it does, then it's likely an issue with the code. If it doesn't, then it may be an issue with the web server configuration.

2 likes
shariff's avatar
Level 51

when I run php artisan serve I can see some warning in console. I cannot able to see actual error in browser. Only I can see This page isn’t working.

WARN thrown in vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php on line 262.

WARN PHP Fatal error: Uncaught Error: Call to a member function make() on null in laravel-crm\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php:262.

WARN Stack trace:

WARN #0 laravel-crm\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(198): Illuminate\Foundation\Exceptions\Handler->report(Object(Symfony\Component\ErrorHandler\Error\FatalError)).

WARN #1 laravel-crm\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(246): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Symfony\Component\ErrorHandler\Error\FatalError)).

WARN #2 laravel-crm\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(270): Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown().

WARN #3 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap{closure}()

1 like
Tharshini_95's avatar

@shariff it looks like the error is being thrown in the Handler.php file in the report() method. You can start by looking at the code in the Handler.php file to see if you can identify the source of the error. It's possible that there's a bug in your code that's causing and object to be null when it shouldn't be.

2 likes
Tharshini_95's avatar

@shariff the error is a fatal error which is why it is not being displayed in the browser.

However, the error should be logged to the Laravel log files, which are usually located in the storage/logs directory.

If you are not seeing any logs in the log file, then it is possible that the logging configuration is not set up correctly.

You can check the logging configuration in the config/logging.php file, and ensure that the log level is set to an appropriate level, such as debug or info.

You can also check if the log file has the necessary write permissions.

phuchautea's avatar

Hello, I think this error is related to a dependency cycle, please check the Dependency Injection (DI).

Please or to participate in this conversation.