[wp-trac] [WordPress Trac] #11570: Change Default Database Error Page
WordPress Trac
wp-trac at lists.automattic.com
Wed Dec 23 03:41:19 UTC 2009
#11570: Change Default Database Error Page
--------------------------+-------------------------------------------------
Reporter: GuruXL | Owner: ryan
Type: defect (bug) | Status: new
Priority: high | Milestone: 2.9.1
Component: Database | Version: 2.9
Severity: normal | Keywords: dbase,database,error
--------------------------+-------------------------------------------------
As a dynamic blogging system, WordPress consists of PHP files (the WP
core) that interact with a MySQL database to generate the web pages for
your website. When everything is working properly, this dynamic
interaction keeps WordPress humming along like a champ, but when your
database crashes, WordPress can’t operate and will deliver the following
message to your visitors:
Error establishing a database connection
I think it’s safe to say that the default database error message:
* is ugly
* is useless to visitors
* is useless to site admins
* reveals sensitive information
A default message should be generated that gives information that the site
is down and doesn't reveal information.
{{{
<?php // custom WordPress database error page tutorial @ digwp.com
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600'); // 1 hour = 3600 seconds
mail("webmaster at domain.com", "Database Error", "There is a problem
with teh database!", "From: Montgomery Scott");
?>
<!DOCTYPE HTML>
<html dir="ltr" lang="en-US">
<head>
<title>503 Service Temporarily Unavailable</title>
<style type="text/css">
h1, p {
font-family: Helvetica, sans-serif;
font-size: 24px;
color: #333;
}
p {
font-size: 14px;
}
</style>
</head>
<body>
<h1>Captain, the ship can’t take much more of
this!</h1>
<p>Perishable Press is currently experiencing technical
issues — Please check back soon!</p>
</body>
</html>
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11570>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list