Title: PHP 5.3 database connection problem
Last modified: August 19, 2016

---

# PHP 5.3 database connection problem

 *  Resolved [nskim](https://wordpress.org/support/users/nskim/)
 * (@nskim)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/php-53-database-connection-problem/)
 * Hi,
 * I’ve been testing PHP5.3 against WP2.6.1.
 * Dprecation issue has been fixed by putting error_reporting(0); to wp-config.php
   file and
 * / Add define(‘WP_DEBUG’,true); to wp-config.php to enable display of notices 
   during development.
    if (defined(‘WP_DEBUG’) and WP_DEBUG == true) { error_reporting(
   E_ALL); } else { error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE); }
 * >  changing “E_ALL ^ E_NOTICE ^ E_USER_NOTICE” to “0” in wp-settings.php file.
   > Has anybody resolved this issue?
   > Thanks in avdvance,
   >  Kim

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/php-53-database-connection-problem/#post-967458)
 * Likely related to [Trac Ticket 8701](http://trac.wordpress.org/ticket/8701). 
   Use your forum login/password there if you are wanting to comment.
 *  Thread Starter [nskim](https://wordpress.org/support/users/nskim/)
 * (@nskim)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/php-53-database-connection-problem/#post-967513)
 * Thanks for your quick response and sorry for delayed reply.
 * I’ve upgraded WP from 2.6.1 to 2.7 and there is an issue with connecting database.
   I think it’s a PHP 5.3 specific issue since PHP 5.2.6 and 5.2.8 work fine.
 * The following is the actual error message.
 * >  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 aaa.bbb.ccc.ddd. 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.
 * However, the same configuration works with other versions of PHPs. Any resolution
   for this?
 * Thanks,
    Kim
 *  [lclarkberg](https://wordpress.org/support/users/lclarkberg/)
 * (@lclarkberg)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/php-53-database-connection-problem/#post-967533)
 * I’ve also been having trouble installing WordPress 2.7, probably because of php
   5.3 incompatibilities. I am using php 5.3.0-dev that came with Glossword WAMP.
   At first I got the deprecation error messages and made the adjustments described
   by nskim. Now I only get a blank page, both when I let WordPress attempt to create
   the wp_config file or if I create it manually. Any suggestions?
 *  [alitfin](https://wordpress.org/support/users/alitfin/)
 * (@alitfin)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/php-53-database-connection-problem/#post-967538)
 * I’m having the exact same problem as lclarkberg. Any suggestions?
 *  Thread Starter [nskim](https://wordpress.org/support/users/nskim/)
 * (@nskim)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/php-53-database-connection-problem/#post-967548)
 * The problem turns out to be it’s a php 5.3 issue. Php 5.3 uses mysqlnd(mysql 
   native driver) instead of mysqllib.dll. This mysqlnd uses an old password authentication
   method which is used below mysql 4.1.
 * But, I need to know how to mysqlnd uses the new style password authentication
   method. Please, let me know anybody knows how to disable old password authentication.
   Thanks.
 *  Thread Starter [nskim](https://wordpress.org/support/users/nskim/)
 * (@nskim)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/php-53-database-connection-problem/#post-967592)
 * Ok, one of our developers has come up with a solution for this.
 * > The problem appears to be that the /etc/my.cnf file has a directive:
   >  old_passwords=1
   > which needs to be changed to
   >  old_passwords=0
   > and then the mysqld server restarted, and then the passwords need to be reset.
   > This eliminates the old passwords from the database.
 * Good luck!
 *  Thread Starter [nskim](https://wordpress.org/support/users/nskim/)
 * (@nskim)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/php-53-database-connection-problem/#post-967593)
 * One more thing about annoying errors messages.
 * Those warning messages will go away when you enable error_log in php.ini file.
 * > error_log=c:\tmp\php.log
 *  [aljames](https://wordpress.org/support/users/aljames/)
 * (@aljames)
 * [17 years ago](https://wordpress.org/support/topic/php-53-database-connection-problem/#post-967623)
 * Hi all…
 * Found a way round the PHP 5.3 database connection issue. If you set your DB_HOST
   parameter to be a ‘hostname:port_number’ pair, it works.
 * E.g. on my system:
 * `define('DB_HOST', 'localhost:3306');`
 * (You might need to change hostname or port number)

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘PHP 5.3 database connection problem’ is closed to new replies.

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 8 replies
 * 5 participants
 * Last reply from: [aljames](https://wordpress.org/support/users/aljames/)
 * Last activity: [17 years ago](https://wordpress.org/support/topic/php-53-database-connection-problem/#post-967623)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
