Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-24-2008, 03:59 AM
Junior Member
 
Join Date: Jan 2008
Posts: 8
Default What's causing this error message? ZF setup

Can anyone pinpoint what the exact problem from this fatal error message?

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

It's been rattling me and I need to figure this out to continue.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-24-2008, 12:33 PM
Member
 
Join Date: Aug 2007
Location: Sweden
Posts: 52
Send a message via MSN to Leif.Högberg
Default

It can't find the error controller. Common causes:
1) File is not named ErrorController.php
2) Above file is not in default module (if using mvc)
3) Class it not named ErrorController
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-24-2008, 04:25 PM
Junior Member
 
Join Date: Jan 2008
Posts: 8
Default

Quote:
Originally Posted by Leif.Högberg View Post
It can't find the error controller. Common causes:
1) File is not named ErrorController.php
2) Above file is not in default module (if using mvc)
3) Class it not named ErrorController
im using mvc, the index.php has been setup so that all requests be redirected to the index.php

the index.php

Code:
<?php
	require_once('Zend/Loader.php');
	Zend_Loader::registerAutoload();
	
	$controller = Zend_Controller_Front::getInstance();
	$controller->setControllerDirectory('../include/Controllers');
	$controller->dispatch();
?>
the IndexController.php

Code:
<?php
    class IndexController extends CustomControllerAction
    {
        public function indexAction()
        {
        }
    }
?>
the NewsController.php which I'm trying to access via "http://phpweb20/news/display"

Code:
<?php
	class NewsController extends Zend_Controller_Action
	{
		public function indexAction()
		{
			echo 'News article index';
		}
		public function displayAction()
		{
		echo 'News article details';
		}
	}
?>
the .htaccess file inside the htdocs folder with the index.php file

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

Last edited by shibuya : 01-24-2008 at 04:28 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-25-2008, 08:39 AM
Member
 
Join Date: Aug 2007
Location: Sweden
Posts: 52
Send a message via MSN to Leif.Högberg
Default

Have you created the view scripts for index and display?
If not you need to add index.phtml and display.phtml to views/scripts/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-26-2008, 08:02 PM
Junior Member
 
Join Date: Jan 2008
Posts: 8
Default

Quote:
Originally Posted by Leif.Högberg View Post
Have you created the view scripts for index and display?
If not you need to add index.phtml and display.phtml to views/scripts/
Yes I have. It's inside the controller directory.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-27-2008, 08:30 AM
Junior Member
 
Join Date: Nov 2007
Location: Sweden
Posts: 12
Default

Add the following to your index.php, it will hopefully give you/us a little more info about your error.

Code:
$controller->throwExceptions(true);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-28-2008, 06:40 AM
Junior Member
 
Join Date: Jan 2008
Posts: 8
Default

Quote:
Originally Posted by Holmen View Post
Add the following to your index.php, it will hopefully give you/us a little more info about your error.

Code:
$controller->throwExceptions(true);
I've added screenshots to make the error more clearer. I've tried and made sure everything is setup but I can't get it to work.



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-28-2008, 06:41 AM
Junior Member
 
Join Date: Jan 2008
Posts: 8
Default

The error I have been getting.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-28-2008, 07:30 AM
Junior Member
 
Join Date: Nov 2007
Location: Sweden
Posts: 12
Default

Quote:
Originally Posted by shibuya View Post
That is the true error message, the first error message(in your first post) will be shown whenever you have ANY error in your ZF application and showExceptions turned off.

Now there is probably something wrong in your directory structure and therefore the display.phtml file cannot be found.

From what I can see in your post display.phtml should be found in "views/scripts/news/display.phtml". If it's in the correct directory please post your full directory structure.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 01-28-2008, 03:50 PM
Junior Member
 
Join Date: Jan 2008
Posts: 8
Default

Quote:
Originally Posted by Holmen View Post
That is the true error message, the first error message(in your first post) will be shown whenever you have ANY error in your ZF application and showExceptions turned off.

Now there is probably something wrong in your directory structure and therefore the display.phtml file cannot be found.

From what I can see in your post display.phtml should be found in "views/scripts/news/display.phtml". If it's in the correct directory please post your full directory structure.
Screenshot of my full directory structure.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:04 PM.