Drupal Tips: How to fix White Screen of Death (WSODs) on form submit

| | 1 min read

A white screen shows up while submitting a form in your Drupal Site?
There could be many possible causes for WSODs (White Screen of Death) in Drupal, such as PHP error reporting settings, memory exhaustion, etc. If the exact reason could be figured out, fixing becomes much easier.

For treating this specific WSOD issue on form submit, check for the following symptoms:

  1. WSOD appears while submitting forms but page loads after refresh.
  2. Go to Admin-menu > Reports > Recent log entries and check for the the following error:

    "Cannot modify header information - headers already sent by (output started at … "

If the above symptom exists try the following remedy:

  1. Check for whitespace and non-printable characters existing outside of php tags, because they cause output and headers are sent unexpectedly.
  2. Remove white spaces and non-printable characters.

Best practices to avoid white spaces and non-printable characters in Drupal:

  1. Follow Drupal coding standard to not include the closing ?> on a PHP file.
  2. Turn off 'Include Unicode Signature (BOM)' option turned on in your editor.

For more information on how to deal with WSODs on your drupal site, visit drupalwsod.com.