Laravel Blank White Screen After Apache and PHP Upgrade
A blank white screen in a Laravel application after an environment upgrade is one of the most frustrating debugging scenarios. It feels like the server is ignoring your requests, but often the issue lies in how Apache handles static files versus dynamic routing before the application even loads. In this specific case, the user upgraded to Apache 2.4 and PHP 5.5.7, which introduced stricter security defaults compared to older versions like Apache 2.2 or PHP 5.3/5.4.
The symptoms are classic: navigating to laravel.mydomain.example results in a completely blank page. There is no output from Laravel's error handler, and the Apache error logs appear empty. However, the .htaccess file is definitely being processed because introducing an invalid line into /var/sites/laravel/public/.htaccess triggers a 500 Internal Server Error. This confirms that the rewrite engine is active and the directory permissions allow for configuration overrides, but the request is failing silently before reaching index.php.
The culprit here is almost certainly the <Directory> block in your virtual host configuration. You are running into Apache's "directory index" behavior. When Apache receives a request for a URL like / or /about, it looks for a default file listed in the DirectoryIndex directive (usually index.php). If that file exists but is not found, or if Apache serves an .html file instead because of misconfigured directives, you might see nothing.
However, the more subtle issue often arises when Options +Indexes is enabled alongside rewrite rules that are supposed to catch everything. When +Indexes is active, Apache may attempt to list the directory contents if it cannot find a valid index file, or it might interfere with the .htaccess logic depending on how the AllowOverride directive interacts with the server root settings.
Looking at your virtual host configuration:
<Directory "/var/sites/laravel/public">
AllowOverride All
allow from all
Options +Indexes
Require all granted
</Directory>
There are two immediate red flags here. First, allow from all is an Apache 2.4 syntax that works for IP addresses but does not grant permission to the request itself in the same way Require all granted does; it's a mix of old and new syntax that can sometimes cause ambiguity depending on the specific module load order. More critically, Options +Indexes is generally bad practice for web applications. It exposes your file structure if a directory index fails to load, which can lead to sensitive information leakage. In the context of a blank screen, enabling indexes might be masking a PHP error or causing Apache to serve a different default than intended.
The second major consideration is the index.php file itself. Since you upgraded to PHP 5.5.7, ensure that the public/index.php file has the correct permissions (usually 644) and is owned by the user running the web server (e.g., daemon based on your apachectl -S output). If Apache cannot execute this script due to permission mismatches introduced during the upgrade, it will return a blank page without logging an error in the standard logs if the access log is not configured correctly.
To troubleshoot this further, you should check the PHP error log specifically, as Apache's error_log might only capture HTTP errors (4xx/5xx), not PHP fatal errors that happen during script execution. Run the following command to locate the PHP error log path:
php -r "echo ini_get('error_log');"
Once you have that path, inspect it for any stack traces related to index.php. If the logs remain silent there, try temporarily removing Options +Indexes from your .htaccess or VirtualHost block. Sometimes, enabling directory listing interferes with the clean output expected by Laravel's routing engine.
Additionally, verify that your DocumentRoot points exactly to /var/sites/laravel/public, not the parent directory. If it points to /var/sites/laravel, Apache will look for index.php in the wrong place, resulting in a blank screen. Your current config shows the correct root, so this is likely resolved, but double-checking prevents configuration drift issues common after upgrades.
If you continue to face issues where the application simply refuses to start, consider disabling PHP opcode caching or checking if the mod_php module is actually loaded for your specific virtual host. In production environments, it is often recommended to switch from mod_php to a process manager like LaravelCompany suggests for handling PHP applications, which isolates the PHP process and prevents environment-specific conflicts that plague shared hosting or older Apache setups.
Finally, ensure that your php.ini settings have not been overwritten during the upgrade. Specifically, check display_errors. If this is set to Off, you will see a blank screen even if PHP crashes. Set it to On temporarily for debugging:
display_errors = On
error_reporting = E_ALL
After making these changes, restart Apache and test the site again. The combination of strict security defaults in PHP 5.5.7 and the legacy syntax mixing in your Apache config is likely the root cause of the silent failure.
