Mysql – PHP fatal error on Zend when upload local site to live site

iisMySQLPHPzend-framework

I used Zend Framwork with Digitalus CMS. I work with ubuntu for test/developping, the website work perfectly fine there. The problem is when I migrate the website to the IIS production server, I get those errors :

PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user 'user'@'subdomin.domain.net' (using password: YES)' in D:\Domains\website.com\wwwroot\library\Zend\Db\Adapter\Pdo\Abstract.php:129
Stack trace:
#0 D:\Domains\website.com\wwwroot\library\Zend\Db\Adapter\Pdo\Abstract.php(129): PDO->__construct('mysql:adapter=P...', 'username', 'password', Array)
#1 D:\Domains\website.com\wwwroot\library\Zend\Db\Adapter\Pdo\Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#2 D:\Domains\website.com\wwwroot\library\Zend\Db\Adapter\Abstract.php(448): Zend_Db_Adapter_Pdo_Mysql->_connect()
#3 D:\Domains\website.com\wwwroot\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES 'utf8...', Array)
#4 D:\Domains\website.com\wwwroot\application\Bootstrap.php(144): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES 'utf8...')
#5 D:\Domains\website.com\wwwroot\library\Zend\Application\Bootstrap\BootstrapAbstract.php(666): Bo in D:\Domains\website.com\wwwroot\library\Zend\Db\Adapter\Pdo\Abstract.php on line 144

I've made some change on the DataBase, but I'm pretty sure these change are not the source of those errors.

What can I do to correct those?

Best Answer

Apparently PHP inform you that he can't access the database. The PDO get an error because he don't have access to the db.

All error come from the fact that you website can't access you db.

Do you have a rollback version? Try it, maybe the change you've made on the database screw this.

If the rollback don't work, then you must add an user with privileges to the website database, and use this user to connect in you php code.

Hope this will help you.

Related Topic