Jump to content

Archived

This topic is now archived and is closed to further replies.

bryantms

Zend Framework Zend_Controller_Dispatch_Exception Issue

Recommended Posts

Hi all -  I'm working through the book Practical Web 2.0 Applications with PHP and have run into an issue.  I am trying to install the main Controllers to handle the site. I have tried to implement an IndexController as follows:

 

IndexController.php

<?php
    class IndexController extends CustomControllerAction
    {
        public function indexAction()
        {
        }
    }
?>

 

This extends CustomControllerAction.php

 

<?php
    class CustomControllerAction extends Zend_Controller_Action
    {
        public $db;

        function init()
        {
            $this->db = Zend_Registry::get('db');
        }
    }
?>

 

I'll also include .htaccess:

RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1

 

And I'll include settings.ini:

[development]

database.type       = pdo_mysql
database.hostname   = localhost
database.username   = phpweb20
database.password   = myPassword (obviously changed)
database.database   = phpweb20

paths.base      = /var/www/phpweb20
paths.data      = /var/www/phpweb20/data
paths.templates = /var/www/phpweb20/templates

logging.file = /var/www/phpweb20/data/logs/debug.log

 

The error I am receiving when I implement all of these is as follows:

 

Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in /var/www/phpweb20/include/Zend/Controller/Dispatcher/Standard.php:241 Stack trace: #0 /var/www/phpweb20/include/Zend/Controller/Front.php(934): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /var/www/phpweb20/htdocs/index.php(18): Zend_Controller_Front->dispatch() #2 {main} thrown in /var/www/phpweb20/include/Zend/Controller/Dispatcher/Standard.php on line 241

 

Has anyone experienced similar problems?  Does anyone have any idea on how to solve this?  Any help is appreciated.  Thanks!

Share this post


Link to post
Share on other sites

I am having the EXACT same problem.

 

I am on Windows XP using Xampp.

 

Did you find the solution?

 

Please let me know.

 

Thanks a lot!

 

Jason

Share this post


Link to post
Share on other sites
Invalid controller specified (error)

 

So, do you have a controller for error pages yet?

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.