Laravel 5.6 HTTP 500 error without any logging

laravel 5.5 logging
laravel 500 internal server error blank page
laravel log full exception
laravel 5.2 http error 500
laravel 5.8 error pages
laravel api error handling
500 server error laravel windows
laravel error log

I'm trying to deploy a Laravel 5.6 application on a shared hosting package. This package uses DirectAdmin with PHP 7.2.

Because of other applications living in sub directories in the public_html directory, I'm forced to also host the application in a subdirectory.

After some doing some research to hosting a Laravel application in a subdirectory, my setup looks like this:

- domains
   - example.com
       - public_html
         - laravel
         - otherapp
         - other_site
       - laravel_code

The laravel folder inside the public_html folder has the same files as every public folder in a Laravel application. This means the files index.php, .htaccess, etc...

The laravel_code folder directory consists of the source code of my application. I know I had to refer my index.php to this folder. I done that like this:

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <taylor@laravel.com>
 */

define('LARAVEL_START', microtime(true));

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels great to relax.
|
*/

require __DIR__ . '/../../laravel_code/vendor/autoload.php';


/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/

$app = require_once __DIR__ . '/../../laravel_code/bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

$response->send();

$kernel->terminate($request, $response);

My .htaccess file looks like this:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On
    RewriteBase /

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

When trying to navigate to the domain, I only get an HTTP 500 error page, without any log files being generated in my storage/logsfolder.

I already tried clearing my cache and caching my config over again. I'm also sure my database credentials are working.

My .env file looks like this:

APP_NAME=WBS
APP_ENV=local
APP_KEY=base64:knjh2YEuePhEzBblBp5zLJQOQEwaiRBOSkmxz1gcYGw=
APP_DEBUG=true
APP_URL=http://www.example.com/laravel/

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=mydomain
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379


PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

The files also have the proper permissions, I gave all the files the 755 permission for testing.

What could cause this HTTP 500 error and how can I fix it?

For errors you might want to look in Apache2/Nginx error logs if the laravel.log is empty.

You still might need to change the public path according to your file structure (taken from here). Add the following to public/index.php:

$app->bind('path.public', function() { return __DIR__; });

Also @Julius' answer is a solution to a common problem when deploying.

[SOLVED] [L5] New: Can't display errors, 500 internal server error, Custom HTTP Error Pages When you start a new Laravel project, error and exception handling is already The report method is used to log exceptions or send them to an external using your exception handler's report method without rendering an error page: 500); } return parent::render($request, $exception); }  Hello guys, I created a fresh Laravel 5.6 project through composer. As I use Homestead, I then added it to Homestead.yml and / etc / hosts , so I up the box with vagrant up . Everything as I usually do, normal.

For testing give storage/ files permissions 777.

chmod -R 777 storage/

Error Handling - Laravel, Master, 7.x · 6.x · 5.8 · 5.7 · 5.6 · 5.5 · 5.4 · 5.3 · 5.2 · 5.1 · 5.0, 4.2. Icon Configuration; Handling Errors; HTTP Exceptions; Handling 404 Errors; Logging By default, the app/start/global.php file contains an error handler for all exceptions: error (404), an "unauthorized error" (401) or even a developer generated 500 error. I have recently upgraded to Laravel 5.6 (from 5.5) and I'm running into an issue where my the \Log() class doesn't work anymore. At first it gave me the following error: laravel.EMERGENCY: Unable to create configured logger.

You can see in official documantation how is it working error handling

https://laravel.com/docs/5.7/errors

You can put on public/index.php this code and catch problem

try {
    $app->run();
} catch(\Exception $e) {
    echo "<pre>";
    echo $e;
    echo "</pre>";
}

Errors & Logging - Laravel, This class utilizes the log configuration option from your config/app.php configuration file. Some exceptions describe HTTP error codes from the server. Errors & Logging. Configuration; Handling Errors; HTTP Exceptions; Handling 404 Errors; Logging; Configuration. The logging handler for your application is registered in the app/start/global.php start file. By default, the logger is configured to use a single log file; however, you may customize this behavior as needed.

I had the same problem. I used this trick to deploy laravel application on shared hosting. Reference Lik

In Laravel 5.6 create .htacess file in your root directory and placed the following code:

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]

RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1 

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php

Hope it will help you.

How To Fix HTTP Error 500 Internal Server Message, Master, 7.x · 6.x · 5.8 · 5.7 · 5.6 · 5.5, 5.4, 5.3 · 5.2 · 5.1 · 5.0 · 4.2 Custom HTTP Error Pages For example, a default log_level of error will log error, critical, alert, and emergency messages: Render an exception into an HTTP response. error (404), an "unauthorized error" (401) or even a developer generated 500 error. For example, exceptions resulting from 404 errors, as well as several other types of errors, are not written to your log files. You may add other exception types to this array as needed: /** * A list of the exception types that should not be reported.

I have the same issue, after trying every solution from answers above, no one of them works. then i tryed to run the code inside Tinker, i found the problem was a infinity loop inside my code. so laravel error handler cannot be work or catch any error.

Error (500), When you start a new Laravel project, error and exception handling is already configured for you. In addition, Laravel is integrated with the Monolog logging library, which provides Some exceptions describe HTTP error codes from the server. (404), an "unauthorized error" (401) or even a developer generated 500 error. This option determines the minimum "level" a message must be in order to be logged by the channel. Monolog, which powers Laravel's logging services, offers all of the log levels defined in the RFC 5424 specification: emergency, alert, critical, error, warning, notice, info, and debug. So, imagine we log a message using the debug method:

How to solve error 500 in Laravel 5.5 on a live server (1and1.com , If you have a VPS or dedicated server, you can view your web site's log files directly at the following paths: /usr/local/apache/logs/error_log; /usr/local/apache/​logs/  i updated a project form laravel 5.5 to 5.6 and in logging section removed log from config/app.php and created logging.php inside config and added the new lines

I cant identify the problem because it only says Error (500) - Please check PHP 5.6.15 gets the installer page up without any error being logged in laravel. GET http://easter.dev/installer/run/29 500 (Internal Server Error)  Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

You can also check the error logs on the server. What does the WordPress error internal server error mean, and how can this be fixed? A htaccess problem, try to test without it; a PHP version not handling your Laravel version, try to check  This can be tricky. If you are using apache, you need to be careful that headers do not get too large. I believe when they go over 8kb, you just get a white screen of death.

Comments
  • Still no success. The only error I see, which is from 15 minutes ago, is this: [Mon Nov 26 11:03:58.038804 2018] [core:error] [pid 2038141:tid 140217619216128] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.example.com/laravel/
  • Then you have an endless-loop in your .htaccess-file. Have you changed it?
  • Now when refreshing the page, the error message doesn't appear in the apache logs.
  • Mario, unfortunately still without succes when making the public folder there and changing the links. Still the same error.
  • I still got the same error 500 page when the methods from app inside a try/catch..
  • Go to you PHP server logs, and look for the PHP error that is causing the WSOD
  • add a die('hello') command at the start of your routes file then keep moving it deeper and deeper into your application until you no longer see the 'hello' message
  • Thanks, where would I put this though? My laravel folder inside public_html has no public/ folder
  • yes inside public_html. you don't have to separate laravel app folder. you don't have to separate public folder also. just deploy from local to the server directly.
  • check this link