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.
- Built the Zend framework
- Uploaded to a folder on the webhost
- Added the "ZEND" folder to the libraries
- Added the connect string stuff to the application.ini file *(a)
- 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)
精彩评论