What is the white screen of death?
The white screen of death, also known as a white page error or blank page error, refers to a problem where a web browser displays a completely blank, white page instead of the expected webpage content. It’s an error message that indicates something went wrong when trying to load the webpage, similar to the well-known “blue screen of death” error on Windows computers.
Some common causes of the white screen of death include:
- Web server issues like misconfiguration or crashing
- Webpage script errors like PHP errors
- Webpage HTML markup errors
- Errors connecting to a database
- Exceeding memory limits
- Exceeding CPU usage limits
- DNS resolution failures
- Corrupt files
- Incompatible web browser
So in summary, a white screen usually means there is a server-side problem or error that is preventing the proper webpage from loading correctly in the browser.
Troubleshooting steps
Here are some troubleshooting steps to try fixing the white screen of death:
Check error logs
The first step is to check the web server’s error logs. The logs should show error messages related to why the white screen is occurring. For example, PHP errors, 404 file not found errors, database connectivity issues, etc. Checking the logs helps narrow down where the problem is originating.
On shared hosting, the error logs are usually found in the /var/log folder. For cloud servers, log into the server and navigate to the appropriate log folder for the web server software being used like /var/log/nginx for Nginx.
Look for error messages around the same time the white screen started occurring, as these are likely related. Google any error codes or messages to better understand the issue.
Test site files
Verify that all necessary site files are present and valid. For example, test that the HTML homepage loads directly by accessing it with a URL like www.example.com/index.html.
If the HTML page fails to load, it indicates a problem with the web server configuration or PHP not processing code properly. If the HTML loads correctly, then focus troubleshooting on PHP pages and scripts.
Review recent configuration changes
Think about any recent changes made to the site, server, DNS records, etc. A new configuration error could easily cause a white screen. Revert recent changes to see if the issue resolves.
Also check that DNS records are still pointed at the correct server IP address and hosted zone.
Test with a different browser
Try loading the website in alternate web browsers like Firefox, Chrome, Safari, etc. Sometimes white screens are caused by browser conflicts.
If the site loads normally in another browser, it points to a browser-specific compatibility issue versus a general server problem. Try clearing the browser cache and cookies as a fix.
Disable plugins and custom code
For WordPress and other CMS sites, try temporarily disabling plugins and custom code to isolate the cause.
Switch plugins to inactive one-by-one until the issue is resolved. Then you know that particular plugin needs to be investigated and updated or removed.
Same concept applies to testing with a default theme versus a custom theme. Switch to a default theme to see if the issue persists.
Increase PHP memory limit
A common source of white screens is exceeding the PHP memory limit. This can happen when a script, plugin, or piece of code requires more resources than allotted.
Try increasing the memory_limit value in the php.ini configuration file on the server. Often increasing it from the default of 128M to 256M or 512M resolves memory exceeded errors.
May also need to increase the max_execution_time to allow longer running scripts.
Check server resources
Is the server out of storage, memory, inodes, or other resources? Use tools like df, du, and top to check disk space, RAM usage, and current processes.
Monitor if any resources are topping out right before the white screen appears. Lack of server resources can easily cause PHP and other processes to fail.
Optimizing images, caches, logs and reducing installations running on the server can free up limited resources related to white screen issues.
Review access and error logs
Uncover clues by checking server access logs around the time the white screen occurs. Look for error status codes like 500 and 504.
Also review operating system logs for hardware and driver issues, kernel panics, etc. Problems at this level could result in a white screen.
Checking all logs helps build a timeline of what was happening leading up to the blank page error.
Perform a curl test
Curl is a command line tool that can request webpages and diagnose connectivity issues.
Try requesting the URL that is white screening with the curl command. It will show the raw HTTP response code and headers returned from the server.
A status of 200 means a proper connection was made. While a status like 500 indicates a server error. Curl checks if a browser issue versus network issue is the cause.
Restart the web server
A simple web server restart will often resolve intermittent white screens. Services like Apache and Nginx can sometimes end up in a bad state that prevents loading pages correctly.
Restarting the web service flushes out any bad connections and resets the server to a clean state.
Best practice is to restart the server regularly like once per week as a preventative measure. Quick restarts are preferable over prolonged uptime.
Clear server caches
Web servers like Nginx and Varnish utilize caching to improve performance. The cached pages become stale over time and need flushing.
Clearing server caches forces freshly rendering pages versus potentially corrupted cached copies. Often white screen issues are simply fixed by refreshing the caches.
CMS systems like WordPress also maintain internal caches that should be cleared when troubleshooting white screens.
Look for conflicts with other servers
Are multiple unrelated web servers hosted on the same system? For example, running both Apache and Nginx on a single server can sometimes conflict and cause problems.
Each daemon may be binding to required ports or attempting to write to the same log files. Carefully review the web server configs for possible overlaps.
Consider isolating each server onto its own dedicated resources to avoid conflicts behind white screens.
Review server security rules
Overly restrictive server firewall policies can block access to required resources and mimic a white screen issue.
Double check that all necessary connections are allowed to databases, secondary web servers like Solr, CDNs, payment providers, etc.
Temporarily disable firewall rules entirely to fully test that no security policies are interfering with normal operation and return a blank page instead.
Load site in development/staging environment
If available, test loading the website in a development or staging environment instead of live production. These pre-production environments are great for safely debugging errors related to white screens.
Changes can be made and tests conducted in staging without impacting actual site visitors until the fix is confirmed. Then the working configuration can be deployed live.
Update web server software
Using the latest stable version of web server software like Nginx, Apache, PHP, MySQL, etc is advisable. Newer versions fix bugs and security flaws that could be contributing to white screen errors.
Be sure to fully read release notes and test compatibility with any server software updates. But maintaining current versions is a best practice.
Contact web host support
If you’ve tried common troubleshooting tips and still cannot resolve the white screen, reach out to your web host’s technical support for assistance. Especially on managed hosting platforms, the host has additional tools available to diagnose and pinpoint the error.
They can analyze server logs, test configurations, check server health, restore from backups, and suggest customized solutions based on experience resolving similar issues for other clients.
Preventing white screens
While occasional white screen errors are hard to avoid entirely, there are ways to minimize the frequency and impact:
- Monitor site regularly and look for early signs of problems
- Configure email or Slack alerts for 500 errors
- Set up redundancy with failover servers and hot backup sites
- Perform load testing to catch capacity limits
- Secure site against traffic spikes and DDoS
- Limit custom untested code running on production site
- Regularly clear caches, expired sessions, temp files
- Establish a rollback plan to revert changes quickly
- Automatically restart web server and services weekly
- Keep software like PHP, OS, plugins updated
- Take regular data backups to allow restores
- Consider high availability and clustering solutions
The key is being proactive with maintenance, monitoring, and security hardening. But also having contingency plans in place to limit downtime if a white screen does occur.
Example white screen scenarios
To better understand real-world examples, here are a few common white screen of death scenarios and fixes:
Database connection failure
Many sites rely on databases like MySQL/MariaDB for their dynamic content. If the web server is unable to connect to the database such as from connectivity issues, exhausted connections, or incorrect credentials, this often results in a white screen.
Troubleshooting steps include:
– Confirm database server is up and accepting connections
– Review database access credentials and permissions
– Adjust max_connections parameter and restart database
– Reduce unused connections from other applications/sites
– Try alternate username/password in case credentials changed
– Check for database replication lag if using master-slave replication
PHP memory exhausted
Complex PHP scripts like those powering WordPress can require significant RAM to process. If PHP lacks sufficient available memory, it will be unable to render pages correctly.
Troubleshooting steps include:
– Increase PHP memory_limit allocation in php.ini
– Optimize memory heavy scripts and plugins
– Reduce number of unnecessary plugins/software running
– Switch to a higher memory hosting plan
– Add more RAM to the server
– Check for memory leaks and restart PHP-FPM regularly
Web server configuration conflict
For example, if Apache and Nginx are both installed on the same server and trying to bind to port 80, this conflict will likely cause a white screen for one or both servers.
Troubleshooting steps include:
– Review all installed web server software configs
– Modify configs to separate domains, ports, and resources used
– Uninstall or disable unnecessary servers like Apache if Nginx is the primary
– Isolate web servers onto their own individual systems
WordPress plugin conflict
With heavy plugin usage, two WordPress plugins can sometimes conflict and cause white screen errors. The issue may only surface when both plugins are active.
Troubleshooting steps include:
– Determine when issue first appeared and plugins updated around that timeframe
– Disable all plugins and re-enable one by one until conflict identified
– Try alternative plugins that provide similar functionality
– Contact plugin authors to report incompatible plugins
Exceeded web server process/thread limits
If too many concurrent users are making requests, web servers like Apache eventually hit configured maximum process/thread limits. Additional connections will be rejected, usually resulting in white screens.
Troubleshooting steps include:
– Increase max connections, processes, threads allowed in config
– Limit unnecessary spider and bot traffic via robots.txt
– Place caches in front of web server to reduce load
– Switch to event-driven web server like Nginx (vs older Apache)
– Scale to a larger server or add nodes for high availability
DNS resolution failure
If the web browser is unable to resolve the configured hostname to an IP address, it will fail to find and connect to the server – presenting a white screen.
Troubleshooting steps include:
– Confirm DNS records have propagated and are resolving correctly
– Check nameservers are responding and domain is not expired
– Try accessing site by IP address instead of domain name
– Flush browser DNS cache and test with alternate browser/device
– Point DNS to different working nameservers temporarily
Server configuration file syntax error
Simple typos and errors in YAML, Nginx configs, .htaccess, and other text files will commonly result in failed parsing and white screens. The web server may fail to start entirely or be unable to respond to requests normally.
Troubleshooting steps include:
– Review all modified configuration files for typos and formatting
– Use YAML/JSON validators to check for valid syntax
– Comment out sections of configuration to isolate issue
– Revert recent changes to confirm working config state
– Consult Nginx/Apache logs for exact parsing errors
Faulty redirect or rewrite rules
Too often, redirects and URL rewrites are configured incorrectly and route all requests into invalid locations, resulting in white screens.
For example, a faulty Nginx rewrite rule rerouting everything to 404 would effectively white screen the entire site.
Troubleshooting steps include:
– Review all redirect and rewrite rules in config files
– Temporarily comment out custom rules until normal site loading confirms culprit
– Pay close attention to regex patterns, flags, conditions, and targets
– Use rewrite debugging tools to better understand rule processing and matching
Web server DDos attack
Malicious actors can sometimes target sites with distributed denial of service (DDoS) attacks. These flood web servers with traffic exceeding maximum capabilities. Legitimate requests receive white screens due to the resource exhaustion.
Mitigation steps include:
– Enforce rate-limiting, enhanced security rules
– Route traffic through cloud anti-DDoS provider (Cloudflare, Akamai, etc)
– Null route attack traffic identified via netflow analysis
– Scale web server resources to absorb higher traffic levels
– Blacklist IP addresses originating attack
Server hardware failure
Failing hard drives, faulty memory, and other physical server issues can certainly cause white screens. Hardware components exceeding their lifespan often exhibit intermittent errors before total failure.
Troubleshooting steps include:
– Review operating system and kernel logs for hardware-related errors
– Perform diagnostics tests on memory and drives (Dell, HP utilities)
– Stress test hardware via utilities like memtest86 and prime95
– Check for overheating issues, insufficient power, loose connections
– Schedule replacement of aging components (3 years+)
Specialized tools
Advanced troubleshooting tools can also help pinpoint tricky white screen conditions:
Web debuggers – Browser extensions like Firefox Debugger and Chrome DevTools allow stepped debugging through CSS, HTML, JavaScript, and network requests on the front end. Can diagnose JavaScript errors, slow network calls, and other browser-side problems.
Developer console – Native console available in most browsers provides output of JavaScript errors, security warnings, caching information, and more that may be contributing to white screens.
Webpage speed tests – Online tools like Pingdom and WebPageTest run automated tests from multiple geographic locations. Reports highlight front-end performance issues and errors for white screening pages.
Server health checks – Services like Pingdom Uptime Monitoring and Uptime Robot perform regular tests of website pages and report failures via email/SMS alerts. Quickly identify when a site white screens.
Content delivery network (CDN) – Adding a CDN like Cloudflare in front of a site often resolves transient network and caching-related white screen errors. CDNs add redundancy, caching, security, and performance benefits.
Load testing – Tools like Apache JMeter and Loader.io can hammer a web server with thousands of concurrent requests to surface white screen errors triggered by high traffic levels.
Error monitoring – Services like Sentry and Raygun provide enhanced error and crash reporting dashboards across frontend and backend code. Aggregate white screen errors in one place for quick diagnosis.
Log monitoring – Platforms like Sematext and Loggly centrally analyze web server logs in real-time. Get alerted on spikes in errors and abnormal traffic causing white screens.
TLDR; Summary
– White screens are caused by web server errors preventing proper page loads
– Enable error logging and check logs for failure clues
– Review server configuration and resources for issues
– Test with alternate browsers and devices
– Disable plugins/code and test sites in staging environments
– Update software, restart web server and database services
– Contact hosting support if problem persists
– Monitor site proactively and implement redundancy
– White screens can be tricky but solvable with systematic troubleshooting!
Conclusion
While the blank white screen with no errors is unquestionably frustrating, it is rarely unfixable. Methodically following typical troubleshooting procedures will surface the underlying error in most cases. Mixing server restarts, log analysis, resource monitoring, graceful degradation of functionality, and reaching out for expert help when needed will ultimately resolve the tricky white screen of death. Just be sure to closely track changes and have robust site monitoring in place to minimize recurrence.