Blank White Screen Problem in Laravel

Blank white screen problem is common in laravel. In this section, we are going to discuss some reasons behind the problem. This screen appears after uploading project in the shared hosting normally. There may be variety of reasons behind this problem. We will discuss some common reasons over here.

Incorrect File/Directory Permission

Incorrect permissions might result blank white screen problem with 500 server error in the console. We can set general permission of laravel project like this:

These are commonly used permissions for laravel project files and directories.

Incorrect Version of PHP

Incorrect php version is most common reason behind blank screen problem. In order to fix this, we can use MultiPHP Manager. You can see this in cpanel main menu.

Multi PHP Manager
PHP version selection

In this way, we can select correct PHP version for our laravel project.

How to change user password in laravel ?

Configuration Cache

Sometime Configuration cache can cause such problem because laravel uses cache for getting configuration data. If you have ssh access to the server then you can execute following command in terminal.

If you don’t have ssh access, don’t worry mate since you can programmatically execute artisan commands. Just add following code to web.php and hit the url in browser.

This command will clear the cache and creates the new one for the project. You have to hit the url: appurl/cache.

Programmatically Executing Commands

This is official laravel documentation for programmatically executing artisan commands.

Middleware

We can use middle ware for variety of reason. Blank screen can appear if we forget to write following code in handle function.

When we assign middle ware to route, the handle function will be executed to check whether it passes middle ware.

View Cache

Laravel also uses view caches since it loads views from the cache. If blank white screen appears even after above steps, we have to clear view cache. We can clear view cache with following command in terminal if we have ssh access.

If you don’t have ssh access then, you can execute it programmatically like this:

Conclusion

In this section, we have discussed about variety of reasons behind the blank white screen problem. Most common reason among these reason is incorrect php version. Other reasons are also responsible for such problem.


sagautam5

sagautam5

Computer Enginner, A Laravel Developer,
http://sagargautam.stacklearning.com

Leave a Reply

Your email address will not be published. Required fields are marked *