OAFC_Rob Posted August 5, 2012 Share Posted August 5, 2012 I have decided to have a bash at teaching myself Zend frameworks, the inital setup etc... has gone smoothly but I want to use MySQL and not SQLite as shown in the quickstart tutorial. I have enabled PDO_mysql in my php.ini file which wasn't there to start with and I have add what I thought was correct lines of code into the confirgation file see below [production] phpSettings.display_startup_errors = 0 phpSettings.display_errors = 0 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" appnamespace = "Application" resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" resources.frontController.params.displayExceptions = 0 resources.view[] = resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/" resources.db.adapter = "PDO_MYSQL" [staging : production] [testing : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resources.frontController.params.displayExceptions = 1 resources.db.adapter = "PDO_MYSQL" resources.db.params.host = "localhost" resources.db.params.username = "root" resources.db.params.password = "password" resources.db.params.dbname = "test" However this doesn't seem to be working and throwing back the following error message Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The PDO extension is required for this adapter but the extension is not loaded' in /var/www/spider-content/library/Zend/Db/Adapter/Pdo/Abstract.php:342 Stack trace: #0 /var/www/spider-content/library/Zend/Db/Adapter/Abstract.php(247): Zend_Db_Adapter_Pdo_Abstract->setFetchMode(2) #1 /var/www/spider-content/library/Zend/Db.php(270): Zend_Db_Adapter_Abstract->__construct(Array) #2 /var/www/spider-content/library/Zend/Application/Resource/Db.php(142): Zend_Db::factory('PDO_MYSQL', Array) #3 /var/www/spider-content/library/Zend/Application/Resource/Db.php(154): Zend_Application_Resource_Db->getDbAdapter() #4 /var/www/spider-content/library/Zend/Application/Bootstrap/BootstrapAbstract.php(683): Zend_Application_Resource_Db->init() #5 /var/www/spider-content/library/Zend/Application/Bootstrap/BootstrapAbstract.php(626): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('db') #6 /var/www/spider-content/library/Zend/Application/Bootstrap/Bootst in /var/www/spider-content/library/Zend/Db/Adapter/Pdo/Abstract.php on line 342 I have had a look around and can't seem to find a solution to this problem, has anyone got any ideas??? I'm pretty stuck at the moment :'( Quote Link to comment https://forums.phpfreaks.com/topic/266701-zend-frameworks-mysql-help/ Share on other sites More sharing options...
ignace Posted August 5, 2012 Share Posted August 5, 2012 enable PDO in your php.ini by removing the ; in front of it. ;extension=php_pdo.so Restart apache afterwards: $ apache2 -k restart If that is not supported: $ apache2 stop $ apache2 start Quote Link to comment https://forums.phpfreaks.com/topic/266701-zend-frameworks-mysql-help/#findComment-1366930 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.