|
I've tried to upgrade an existing PHP 5.2.x site running WordPress to PHP 5.4 by editing my .htaccess file. Unfortunately this immediately results in the dreaded Error establishing a database connection WordPress error. Has anyone else experienced this? I have multiple WordPress installs and it happens on all of them. Why would upgrading the PHP version have any effect on the DB connection? |
|
Some other PHP applications we have seen are unable to access the database after an upgrade to PHP 5.4, and have a specific error similar to the following:
In order to rule out this possibility, try setting your password for your database again in the WebFaction Control Panel. This should perform the " |
|
OK, I just added < FilesMatch .php$>
SetHandler php54-cgi
< /FilesMatch>
to my .htaccess file to prep for the support ticket and lo and behold - it works. The only difference was, this time I just used vim to edit the file. Wherease before I was using this plugin to manage changes to .htaccess. Who knows. I'm just happy that it's working! Thanks your input and hope I didn't waste too much of your time. Glad to hear you found the source of the problem. I spoke too soon! Was looking at a cached version of that page. The good news is that simply resetting the DB password from my control panel works fine. Onwards.. |
|
PHP 5.4 changed to mysqlnd (native driver) instead of libmysql, therefore OLD mysql (pre mysql 4.1) passwords are not supported with mysqlnd, simply change your db password as solution, make sure your mysql installation does not enforce old-style passwords (phpmyadmin passwd change function will let you choose which password style to use old or new) |