My laravel site was working before, I recently upgraded to Apache 2.4 and PHP 5.5.7.
Now I'm getting a white blank screen when I go to laravel.mydomain.com, nothing in apache error logs, routes and etc. should be fine as it worked before.
.htaccess is loading as I get a 500 when I insert an invalid line to /var/sites/laravel/public/.htaccess.
Heres my .htaccess:
$ cat /var/sites/laravel/public/.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
Heres my virtual host directive:
DocumentRoot "/var/sites/laravel/public"
ServerName laravel.mydomain.com
<Directory "/var/sites/laravel/public">
AllowOverride All
allow from all
Options +Indexes
Require all granted
</Directory>
And apachectl -S
$ /usr/local/apache2/bin/apachectl -S
VirtualHost configuration:
*:* is a NameVirtualHost
default server mydomain.com (/usr/local/apache2/conf/extra/httpd-vhosts.conf:25)
port * namevhost mydomain.com (/usr/local/apache2/conf/extra/httpd-vhosts.conf:25)
port * namevhost laravel.mydomain.com (/usr/local/apache2/conf/extra/httpd- vhosts.conf:34)
ServerRoot: "/usr/local/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/usr/local/apache2/logs/error_log"
Mutex rewrite-map: using_defaults
Mutex default: dir="/usr/local/apache2/logs/" mechanism=default
PidFile: "/usr/local/apache2/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="daemon" id=1 not_used
Group: name="daemon" id=1 not_used
for anyone who get blank page even after making storage accessible for displaying errors put these two lines at first lines of public/index.php to see what is happening at least. for me this error was there :Class 'PDO' not found in /var/www/***/config/database.php on line 16
When I was new to Linux.I usually found this error with my Laravel Project. White errors means error, It may have some permission issue or error.
You just have to follow two steps, and will work like champ :)
(1) Give the permission. Run these command from root directory of your project
(2) If you cloned the project or pulled from github then run
(3) Configure your .env file properly, and your project will work.
In my case , I have installed
laravel
many times, and I am sure that the folder write permission has been correctly given.Like most of the answers above :
The mistake is that my nginx configuration comes from the official documentation.
I only modified the domain name after copying ,then I got a blank page. I tried restarting
nginx
andphp-fpm
,but not work for me.Finally, I added this line configuration to solve the problem.
I hope I can help others.
Other problem with the same behavior is use Laravel 3 with PHP 5.5.x. You have to change some laravel function's name "yield() because is a reserved word in php 5.5
I have some issues to setup it in a Vagrant machine. Whats really works for me was execute a:
chmod -R o+w app/storage/
from inside the Vagrant machine.
Reference: https://laracasts.com/lessons/vagrant-and-laravel
Strange for me, but in my case I had to clear the laravel's cache to solve the issue.