The symptoms:
Your site is suddenly down. If in production mode, a blank & empty page is displayed.
The solution:
After checking that the MySQL daemon still works, Apache is running, PHP is working and the configuration has not been changed (a test.txt file is served correctly), you might want to look into your PHP error log.
Here's how you add PHP error logging to your .htaccess, if you do not have it already:
# php error logs..
php_flag display_errors off
php_flag log_errors on
php_value track_errors on
php_value error_log /path/to/php.error.log
Be sure to chown the file to www-data:www-data or whatever your PHP process is running under.
In my case, the culprit was a very strange "duplicate entry" error:
[09-Jun-2010 20:18:49] PHP Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [1062: Duplicate entry '300969' for key 1] in EXECUTE("insert into PageStatistics (cID, uID, date) values ('1', 0, NOW())")
' in /…/concrete5.4.0.5/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php:78
Stack trace:
#0 /…/updates/concrete5.4.0.5/concrete/libraries/3rdparty/adodb/adodb.inc.php(1037): adodb_throw('mysql', 'EXECUTE', 1062, 'Duplicate entry…', 'insert into Pag…', false, Object(ADODB_mysql))
#1 /…/concrete5.4.0.5/concrete/libraries/3rdparty/adodb/adodb.inc.php(993): ADOConnection->_Execute('insert into Pag…')
#2 /…/updates/concrete5.4.0.5/concrete/libraries/3rdparty/adodb/adodb.inc.php(761): ADOConnection->Execute('insert into Pag…', Array)
#3 [internal function]: ADOConnection->Query('insert into Pag…', Array)
#4 /…/updates/concrete5.4.0.5/conc in /…/updates/concrete5.4.0.5/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php on line 78
After checking the appropriate table (used for logging visits to your C5 page), I could not understand the error – there was no entry for key 300969, the last entry was 300968.
Here's a quick way to turn off page statistics, which will fix this error and bring your site back on: Put this line o'code in your config/site.php
define('STATISTICS_TRACK_PAGE_VIEWS', false);
In PHPMyAdmin there's the option to manually increase the auto_increment value. I increased it by one to 300970 and the site was working again, with statistics (comment the line you just inserted.)
There's a couple of pages out there, currently having this problem (searching with Google helps). I'm offering a low-cost watchdog service for Concrete5 sites – be back up again before your visitors notice!