Drupal White Screen of Death Fix
In this tutorial, you'll learn about Drupal White Screen of Death Fix. We cover key concepts, practical examples, and best practices.
The Problem
Your Drupal site shows a completely blank white page. No error message, no HTML output. The admin pages are also blank. PHP encountered a fatal error but error reporting is disabled.
Quick Fix
Step 1: Enable error reporting
$config['system.logging']['error_level'] = 'verbose';
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
Step 2: Check PHP error log
tail -100 /var/log/apache2/error.log | grep "PHP"
Step 3: Increase PHP memory
ini_set('memory_limit', '256M');
Step 4: Disable modules via Drush
drush pm:list --status=enabled
drush pm:disable module_name
drush cr
Step 5: Check for syntax errors
php -l sites/all/modules/custom/my_module/my_module.module
Prevention
- Enable verbose logging only on development sites.
- Test modules on staging before production.
- Keep Drupal core updated.
Common Mistakes with white screen
- Overlapping type class instances that cause GHC to reject the program with ambiguous dispatch errors
- Non-exhaustive pattern matches that compile with warnings then crash at runtime
- Misunderstanding that
Stringis[Char]with poor performance for large text operations
These mistakes appear frequently in real-world DRUPAL code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.
Practice Exercise
Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.
This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.
FAQ
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro