Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2005-10-26 17:01:06
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
MySQL failure - error page dump
When MySQL tanks I get a nasty page dump like this. I see this on a few other popular Textpattern sites, too. Is this Textpattern prefs causing this? Does it have to do with “production status”, or is this something else?
Offline
#2 2005-10-26 21:17:27
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: MySQL failure - error page dump
Textpattern was unable to open a connection to the database. It couldn’t be affected by a preference, because prefs are stored in the database.
If you’re on a shared hosting service, this was almost certainly caused by another user with a runaway process.
Alex
Offline
#3 2005-10-26 21:46:04
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: MySQL failure - error page dump
No, sorry I wasn’t clear. I realize that MySQL was failing – what I’m curious about is outputting all the error messages vs. silently failing with just “Database unavailable”.
Offline
#4 2005-10-26 21:50:29
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: MySQL failure - error page dump
So my php.ini is set to “display_errors = Off” and my (inaccessible) prefs production status is set to “Live”. The root index.php has these lines:
// Make sure we display all errors that occur during initialization
error_reporting(E_ALL);
@ini_set("display_errors","1");
Is that what’s overriding my php.ini?
Last edited by Andrew (2005-10-26 21:50:40)
Offline
#5 2005-10-26 21:56:00
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: MySQL failure - error page dump
Yep. That’s the one.
Offline
#6 2005-10-26 22:04:36
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: MySQL failure - error page dump
Shouldn’t the DB class check to see if the mysql_connect()
was successful (with errors suppressed) and then only execute mysql_get_server_info()
and mysql_select_db()
if the link was successful? It looks like that was almost done at some point, with $GLOBALS['connected']
, but not quite.
Offline
Re: MySQL failure - error page dump
I already checked in a bit nicer handling, you’re right that a user doesn’t need to see those errors cascading. The relevant error-message will now be in an html-comment below a simple “unavailable message”.
Offline
#8 2005-10-26 22:46:41
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: MySQL failure - error page dump
Very nice. That was quick.
Last edited by Andrew (2005-10-26 22:47:46)
Offline
Pages: 1