Over the weekend one of our websites went down but we didn’t notice it till we got back to work on Monday.
The strange part was that wp-admin was working as nothing happened and only the front-end was disabled. We tried everything from the standards:
- Disable plugins and revert to the default theme
- Increase WP Memory Limit and turn WP Debug mode on
- Check the error log and errors within Chrome dev. tools
and none of these gave any results..
However, the solution here was way simpler than what we expected. Simply update to the latest WordPress version.
That worked for us, however, if you are experiencing the same issue and just updating the WordPress core doesn’t solve the problem for you, I recommend opening the inspect element tool in Chrome and check for any errors.
PHP Memory Limit
Looks like your are running up against the PHP memory limit. Edit the file
/etc/php5/apache2/php.ini and increase the memory limit. Find this part of the file:
; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit = 128M
and increase the number to something higher. Then restart Apache with:
sudo service apache2 restart
Though this also suggests that you should audit your plugins to see what’s using the memory.
Re-upload WordPress core
To do this, go to WordPress.org and download the latest version. Unzip it on your pc and remove the wp-content folder. Afterwards, compress the files again and upload to your domain. Unpack and replace all files on the server. Since we removed the wp-content folder earlier, that contains your media, plugins and themes, only the core will be replaced. This helps if there is a script added to that page to make it overload.
It’s time to step up your server security game so that this doesn’t happen again.