开发者

Can't Connect Zend to MySQL

I'm new to the Zend Framework and trying to figure some stuff out. I wonder if anyone could help me figure out why I'm unable to connect to a MYSQL database on my live server (a Cpanel / shared style webhost).

I've taken the following steps.

  1. Built the Zend framework
  2. Uploaded to a folder on the webhost
  3. Added the "ZEND" folder to the libraries
  4. Added the connect string stuff to the application.ini file *(a)
  5. Reloaded the page

*(a) The connection information I've added goes like this:

 resources.db.adapter = PDO_MYSQL
 re开发者_运维技巧sources.db.params.host = localhost
 resources.db.params.username = cpanel_dbuser
 resources.db.params.password = 123456
 resources.db.params.dbname = cpanel_db

the error I'm getting reads like

Fatal error: Uncaught exception 'Zend_Config_Exception' with message 'Error parsing /home/path/application/configs/application.ini on line 13 ' 
in /home/path/library/Zend/Config/Ini.php:181 Stack trace: 
    #0 /home/path/library/Zend/Config/Ini.php(201): Zend_Config_Ini->_parseIniFile('/home/path/...') 
    #1 /home/path/library/Zend/Config/Ini.php(125): Zend_Config_Ini->_loadIniFile('/home/path/...') 
    #2 /home/path/library/Zend/Application.php(383): Zend_Config_Ini->__construct('/home/path/...', 'production') 
    #3 /home/path/library/Zend/Application.php(85): Zend_Application->_loadConfig('/home/path/...') 
    #4 /home/path/public/index.php(25): Zend_Application->__construct('production', '/home/path/...') 
    #5 {main} thrown in /home/path/library/Zend/Config/Ini.php on line 18

EDIT Line 13 of my application.ini is the password. Which has an exclamation point in it. Which if I change the password for the database user now works.

No exclamation points in Zend DB passwords.


FYI - please don't struggle to answer this for me.

Up above I've already answered the question:

No exclamation points in Zend DB passwords.

I'd delete the question but for the sake of others' I thought I'd leave the answer here. (Search engines might save someone a bit of time)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜