Thursday, May 26, 2011

Thursday, April 1, 2010

Zend Framework

When I got this error

Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (zf-tutorial)' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zf-tutorial\library\Zend\Controller\Dispatcher\Standard.php:242 Stack trace: #0 C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zf-tutorial\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zf-tutorial\index.php(42): Zend_Controller_Front->dispatch() #2 {main} thrown in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zf-tutorial\library\Zend\Controller\Dispatcher\Standard.php on line 242



I had to add php_pdo.dll and php_pdo_mysql.dll in the phpi.ini as extensions

Also, I had to correct the DB name in applications/config.ini

The db name that I intended to use was zf_test, so I had to check if this was created correctly in mysql - as well as the entry in the config.ini

---
Problem:

Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (zf-tutorial)' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zf-tutorial\library\Zend\Controller\Dispatcher\Standard.php:242 Stack trace: #0 C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zf-tutorial\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zf-tutorial\index.php(43): Zend_Controller_Front->dispatch() #2 {main} thrown in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\zf-tutorial\library\Zend\Controller\Dispatcher\Standard.php on line 242


TroubleShoot:

I added this in the
$frontController->setParam ('useDefaultControllerAlways', true );

after this I was able to go to http://.../zf-tutorial/index.php