WordPress White Screen of Death

27/10/2018

It seem that every time I need to upgrade my wordpress site that this blog runs on, I end up with the white screen of death. Basically it means that the upgrade failed somehow and the page can’t no longer render.

My site run a cheap shared hosting platform from gigahost.dk, and from what I gather online, the white screen of death is usually cause by too little memory to run upgrade.

My way around this problem, is to run wordpress from a docker container on my local machine but connected to my real wordpress database. That way I’m able to run the upgrade successfully locally, and then my hosted wordress works again.

The process are

  1. Install wordpress upgrade from wordpress admin
  2. If white screen of deaths happens, the FTP into my wordpress host can copy all files to a local directory, e.g. j:\projects\wordpress-docker\wp
  3. Run docker-compose up, see compose file below
  4. Change c:\windows\system32\drivers\etc\hosts to point wp.sjkp.dk to 127.0.0.1
  5. Open my admin panel and see the upgrade completed
  6. Clean up hosts file


version: '2'

services:
wordpress:
image: wordpress:latest
ports:
- "80:80"
restart: always
volumes:
- j:/projects/docker-wordpress/wp:/var/www/html # Full wordpress project
environment:
WORDPRESS_DB_HOST: #Replace with your host
WORDPRESS_DB_PASSWORD: #Replace with your password
WORDPRESS_DB_USER: #Replace with your database user
WORDPRESS_DB_NAME: #Replace with your database name

Hope this helps some one, and if not I have a reference for next time 🙂