2

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?

Achu
  • 231
  • 1
  • 2
  • 11
  • 1
    Your post lack some information. Do you use IIS or wampp? What difference between your test machine and your prod machine. To be sure to avoid this kind of error, I'm used to create a VM copy of the production machine, then I work on the VM, and when I need to migrate from test site to production site, no surprise. That's just an advice for your future web project ^^ – Anarko_Bizounours Jul 05 '11 at 09:04
  • @Anarko_Bizounours Thanks for your advice my local machine is Ubuntu Apache and my shared host company using IIS. I completely sure my DB configuration is correct but i don't what was that. – Achu Jul 05 '11 at 09:22
  • I wonder if you IIS have PDO installed. There is a easy way to find what your prod machine lack compared to your ubuntu. Create on your ubuntu a index.php with this code in it "", do the same on your IIS. Then look what this prompt on ubuntu and IIS, maybe you'll find some package lacks on IIS. – Anarko_Bizounours Jul 05 '11 at 09:26
  • @Anarko_Bizounours my host server not allow me to run that file it says "it is disable for security reason". – Achu Jul 05 '11 at 10:26
  • weird, normally this should run without problem. I'm not really used to IIS, but it seems it's definitly from your IIS configuration. It's out of my expertise field. I'll try looking around to find some solution. – Anarko_Bizounours Jul 05 '11 at 10:31

2 Answers2

2

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.

1

Check your application.ini, you need to define corresponding database credentials for both production and development section.

Optimus
  • 169
  • 1
  • 11