Between 30-August-2013 and 01-September-2013, Complete, Concrete, Concise had its web hosting suspended with a demand that the WordPress installation be deleted.
Not wanting to delete my installation and then reinstall (and hopefully restore all data correctly), I investigated.
Note: this problem and solution is likely the same for any PHP based application – like Joomla! or Drupal.
Symptoms
Most likely, your web hosting provider will inform you that your account has been suspended because your WordPress (or other PHP based application) is generating a lot of core dumps and playing havoc with their server. In my case, I was asked to delete my WordPress installation.
Alternately, you may notice there are a lot of core.xxxx
(xxxx being a four digit number) files in your WordPress directory.
The Cause
There may be other causes for core dumps, but this is what was causing mine.
When your error_log
file gets to be 2,147,483,647 bytes long, PHP will start crashing and generating core dumps. This is because PHP cannot handle files larger than 2GB.
error_log
is where PHP stores messages about any errors it encounters.
The most common cause of errors is a corrupt MySQL database file.
I suspect this is a fairly common problem but I could only find it mentioned here.
PHP’s failure in dealing with files larger than 231 – 1 bytes long is documented here (although, the expression “unexpected behaviour” doesn’t really do it justice). To be fair, the PHP documentation claims this is only a problem on 32-bit systems – however, since I don’t know if my web host is running a 32 or 64 bit version of Linux, I can’t say anything other than “it is really stupid to not fail gracefully at a known hard limit”.
The Fix
When your account is suspended, you will probably only have ftp
access.
- Delete the file
error_log
. - rename
index.php
to something else (xxx_index.php
is good) - inform your hosting provider that:
- you suspect the problem was PHP’s inability to handle and
error_log
larger than 2GB and you have deleted it - you have deactivated your WordPress account by renaming
index.php
- you would like access to your account restored so you can run MySQL applications to check and repair your database if necessary
- you suspect the problem was PHP’s inability to handle and
- Fix the database (if it is corrupted). Instructions for checking and repairing a database can be found here.
- restore the name of the file in step (2) back to
index.php
- go to your website and browse a few pages.
- verify that
core.xxxx
files are not being generated. If they are being generated, than you probably have some other problem. - verify that the file
error_log
is not being generated. If it is being generated, it is a good idea to look at it and see what errors are occurring. Depending on how quicklyerror_log
is growing, it might be a good idea to suspend your site again by renamingindex.php