The White Screen of Death (WSOD) is a common yet frustrating issue. It’s often caused by PHP errors, memory limits, or plugin/theme conflicts. We’ll look at common error messages associated with the WSOD, and guide you through simple troubleshooting steps to bring your site back to life.
1. Fatal Error: Allowed Memory Size Exhausted
This error occurs when your WordPress site runs out of memory. It usually happens when a plugin or script consumes more resources than what’s allocated by the server.
You’ll need to increase the PHP memory limit:
- Open your
wp-config.php
file in your WordPress root directory. - Add the following line:
define('WP_MEMORY_LIMIT', '256M');
If 128MB isn’t enough, you can increase the limit further (e.g., 512M
), depending on your server restrictions.
2. Fatal Error: Call to Undefined Function
This error occurs when a function is being called that doesn’t exist, often due to an outdated or missing plugin or theme. In this case, the function is_woocommerce()
is part of WooCommerce, so if WooCommerce isn’t installed or activated, it results in an error.
Step 1: Disable the problematic plugin or theme
- If you can access the admin dashboard, deactivate the plugin/theme.
- If not, connect via FTP and navigate to
wp-content/plugins
orwp-content/themes
. Rename the folder of the problematic plugin or theme (e.g.,mytheme_old
).
Step 2: Ensure the necessary plugin (e.g., WooCommerce) is installed and activated.
Step 3: Update all your plugins and themes to the latest versions.
3. Parse Error: Syntax Error
A syntax error usually happens when a file contains incorrect PHP code, such as a missing semicolon, incorrect function usage, or an extra bracket.
- Go to the specified file and line number where the error occurred (in this case,
functions.php
at line 78). - Look for any missing or extra symbols like
;
,{
,}
, etc. - Correct the code and save the file.
If you can’t access the admin dashboard, connect via FTP, download the affected file, make changes, and upload it again.
4. 500 Internal Server Error
A 500 Internal Server Error can be caused by a corrupted .htaccess
file, incorrect file permissions, or an issue with a plugin or theme.
Step 1: Check the .htaccess file.
- Connect via FTP and locate the
.htaccess
file in the root directory of your WordPress installation. - Rename it to something like
.htaccess_old
. - Go to Settings > Permalinks in the WordPress dashboard and click Save Changes to regenerate the
.htaccess
file.
Step 2: Check File Permissions.
- Folders should have permissions set to
755
. - Files should have permissions set to
644
. - Use an FTP client to adjust these permissions.
Step 3: If the above steps don’t work, disable all plugins and switch to the default theme to identify the cause.
5. Warning: Cannot Modify Header Information
This error occurs when WordPress tries to modify HTTP headers, but output has already been sent. Often, this is due to extra whitespace or characters being output before the <?php
opening tag in a theme or plugin file.
- Open the file mentioned in the error (in this case,
header.php
). - Ensure that there are no empty lines or spaces before the
<?php
tag at the beginning of the file. - Save the file and reload your site.
6. Fatal Error: Maximum Execution Time Exceeded
This error occurs when a script takes too long to execute and exceeds the server’s time limit. You’ll need to increase the maximum execution time:
Edit your .htaccess
file (located in the root directory) and add this line:
php_value max_execution_time 300
This increases the execution time to 300 seconds.
Alternatively, if you have access to your hosting control panel, you can increase the execution time through the PHP settings.
7. Error Establishing a Database Connection
This error occurs when WordPress is unable to connect to the database. It’s usually due to incorrect database credentials or issues with the database server.
Step 1: Check your database credentials in the wp-config.php
file:
define('DB_NAME', 'your_database_name');
define('DB_USER', 'your_database_user');
define('DB_PASSWORD', 'your_database_password');
define('DB_HOST', 'localhost');
Step 2: If your database details are correct, contact your hosting provider to check whether the database server is down or overloaded.
Step 3: You can also try repairing your database. Add this line to wp-config.php
:
define('WP_ALLOW_REPAIR', true);
Then visit yoursite.com/wp-admin/maint/repair.php
and follow the on-screen instructions.
Dealing with the White Screen of Death is frustrating, but the error messages you get can usually help you figure out what’s wrong. Whether it’s a memory issue, a plugin conflict, or a problem with your database, the solutions above should help you get your WordPress site back up and running in no time. Just be sure to back up your site before making any big changes so you don’t lose anything important.
By getting familiar with these common WSOD errors and how to fix them, you’ll save yourself time and stress the next time something goes wrong!