Laravel blank white screen
An update to fideloper's answer for Laravel 5 and its new file structure is:
$ sudo chmod -R o+w storage/
Apache
Does this answer describe or help your situation? Upgrading to Apache 2.4 come with some changes in Apache configuration.
Laravel
Are you checking Laravel's logs or Apache's logs?
Since upgrading to Laravel 4.1, I've had white screen "errors" (WSOD) when the application could not write to the log location. I've always solved this by making the app/storage directory writable by Apache (either group writable to "www-data", "apache" or world-writable - that depends on your server setup.
Web Server User
On Ubuntu/Debian servers, your PHP may be running as user "www-data". On CentOS/RedHat/Fedora servers, you PHP may be running as user "apache".
Make sure your files are owned by the user that is running PHP:
# Debian/Ubuntu
$ sudo chown -R www-data /path/to/laravel/files
# CentOS/RedHat/Fedora
$ sudo chown -R apache /path/to/laravel/files
Note that you might not be running as user www-data or apache. It depends on your hosting and setup!
Laravel 4
# Group Writable (Group, User Writable)
$ sudo chmod -R gu+w app/storage
# World-writable (Group, User, Other Writable)
$ sudo chmod -R guo+w app/storage
Laravel 5+ (including 6)
# Group Writable (Group, User Writable)
$ sudo chmod -R gu+w storage
# World-writable (Group, User, Other Writable)
$ sudo chmod -R guo+w storage
#####
# The bootstrap/cache directory may need writing to also
##
# Group Writable (Group, User Writable)
$ sudo chmod -R gu+w bootstrap/cache
# World-writable (Group, User, Other Writable)
$ sudo chmod -R guo+w bootstrap/cache
Try this, in the public/index.php page
error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
ini_set("display_errors", 1);
The following steps solved blank white screen problem on my Laravel 5.
- Go to your Laravel root folder
- Give write permission to
bootstrap/cache
andstorage
directories
sudo chmod -R 777 bootstrap/cache storage
- Rename
.env.example
to.env
- Generate application key with the following command in terminal/command-prompt from Laravel root:
php artisan key:generate
This will generate the encryption key and update the value of APP_KEY
in .env
file
This should solve the problem.
If the problem still exists, then update config/app.php
with the new key generated from the above artisan key generate command:
'key' => env('APP_KEY', 'SomeRandomString'),
to
'key' => env('APP_KEY', 'KEY_GENERATED_FROM_ABOVE_COMMAND'),