PHP Memory Exhaustion | A common cause of the WSOD (White Screen of Death)

If you are experiencing issues with your PHP based website in Cloud Sites, and are seeing the “White Screen of Death” the first thing you will want to check is your php_errors.log file which is located within the logs directory of your website in FTP.

By default, php errors are logged to that file unless otherwise specified by your application.

A very common PHP error is the “PHP Fatal error: Allowed memory size of XXXXX bytes exhausted” error.

Fortunately this is a relatively simple issue to fix.

Rackspace Cloud’s default PHP memory is set to 32M. Some plugins or themes may require more memory than this to process.

To increase the PHP memory you will need to edit the .htaccess file within your /web/content/ directory (or create a .htaccess file if it does not already exist) and add the following line of code towards the top of the file:

php_value memory_limit ?M

Replace the ? with the amount of php memory you wish to allocate. We recommend increasing it to 64M unless more is necessary.

Keep in mind that more php memory will NOT make your website run faster. Too much php memory may actually make your website run slower. The php memory value is how much memory your application is requiring to load each webpage.

So as you can imagine, if your application is requiring upwards of 128M of memory just to load a single webpage it probably won’t load very quickly. 😀