• Hello. When my site is down due to server downtime. When I reach my site. A white page appears with the following.

    >>>>>>>>>>>>>>>>>>>>>>>Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.

    * Are you sure you have the correct username and password?
    * Are you sure that you have typed the correct hostname?
    * Are you sure that the database server is running?

    If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

    could you tell me if i can change that page and instead appear a page with something i wrote myself? thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • wp-db.php

    If you see that page so much you want to make it look nice, it’s a message to change hosts 🙂

    Thread Starter parisgv

    (@parisgv)

    i am really afraid to change hosts. need someone to help me move my whole wordpress, lol

    Thread Starter parisgv

    (@parisgv)

    thanks, also do you know how to change the image of WordPress on the wp-db.php? i searched but it’s only codes. i found the text-code but not the HUGE WordPress logo, lol

    by the way, i tried to change the text BUT it says:

    Parse error: parse error, unexpected T_STRING in /home2/parisgv/public_html/site/wp-includes/wp-db.php on line 46

    Thread Starter parisgv

    (@parisgv)

    will someone help? thank you!

    In wp-db.php is this part (the error message):
    $this->bail("
    <h1>Error establishing a database connection</h1>
    <p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>$dbhost</code>. This could mean your host's database server is down.</p>
    <ul>
    <li>Are you sure you have the correct username and password?</li>
    <li>Are you sure that you have typed the correct hostname?</li>
    <li>Are you sure that the database server is running?</li>
    </ul>
    <p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>
    ");

    Please print what you have out there instead.
    Not the whole file, JUST that part.

    Thread Starter parisgv

    (@parisgv)

    thats what i added/replaced

    // DB Constructor – connects to the server and selects a database

    function wpdb($dbuser, $dbpassword, $dbname, $dbhost) {
    $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
    if (!$this->dbh) {
    $this->bail(“
    <div align=”center”>
    <center>
    <table border=”1″ cellspacing=”0″ style=”border-collapse: collapse” bordercolor=”#C0C0C0″ width=”60%” id=”AutoNumber1″ bgcolor=”#EAEAEA”>
    <tr>
    <td width=”100%” align=”justify”><font face=”Century Gothic”><b>
    <font color=”#FF0000″>ERROR (Announcement):</font> </b>Welcome to <b>
    JustShannen.com</b> a fansite dedicated to the actress, Shannen Doherty.
    I’m sorry but the <b>site is temporally down due to technical problems.</b>
    If the problem remains (for more than 24hrs) send us an

    <font color=”#000000″>email</font>
    .</font><p align=”center”>
    <font face=”Century Gothic”>Thank you and <b>check back soon! </b>- from
    tech. department</font></td>
    </tr>
    </table>
    </center>
    </div>

    “);

    I realize that this is an old thread and the problem may have been resolved. However, this is the first (in the many that I have searched about customizing wp-db.php) that deals with specifics of HOW to go about doing so.

    I don’t know for certain that this is the answer to fixing the parse error is to change the quotation mark into a single quotemark after bail( and before the final );. You will also have to escape the apostrophe in I’m sorry by putting a backslash before the apostrophe.

    $this->bail('
    <div align="center">
    [...]
    I\'m sorry but the <b>site is temporally down due to technical
    [...]
    ');

    I’m with davgam on this issue: http://wordpress.org/support/topic/36534#post-257124

    It isn’t always a viable option to switch hosts. And it would be very nice if the error page could be easily made to match the look of the site that the wordpress blog is on rather than matching the look of wordpress.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to change the Error WordPress page when the site is down?’ is closed to new replies.