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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-09-2008, 09:53 PM
Junior Member
 
Join Date: Mar 2008
Posts: 4
Default 'Cannot load controller class "IndexController"

I have bootspraper code from tutorial:
PHP Code:
<?php
ini_set
('display_errors''on');
error_reporting(E_ALL);
date_default_timezone_set('Europe/London');
set_include_path('.' PATH_SEPARATOR './library'
   
PATH_SEPARATOR './application/models/'
   
PATH_SEPARATOR get_include_path());

include 
"Zend/Loader.php";
Zend_Loader::loadClass('Zend_Controller_Front');

// setup controller
$frontController Zend_Controller_Front::getInstance();
$frontController -> setBaseUrl('/zend/');
$frontController->throwExceptions(true);
$frontController->setControllerDirectory('./application/controllers');

// run!
$frontController->dispatch();
?>
all dirnames and filenames are correct, mod_rewrite is on, htaccess:

Code:
RewriteEngine on
RewriteRule .* index.php

php_flag magic_quotes_gpc off
php_flag register_globals off
and on localhost i'v error:
Quote:
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Cannot load controller class "IndexController" from file "IndexController.php" in directory "\"' in G:\Strony\zend\library\Zend\Controller\Dispatcher\ Standard.php:295 Stack trace: #0 G:\Strony\zend\library\Zend\Controller\Dispatcher\ Standard.php(212): Zend_Controller_Dispatcher_Standard->loadClass('IndexController') #1 G:\Strony\zend\library\Zend\Controller\Front.php(9 31): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #2 G:\Strony\zend\index.php(19): Zend_Controller_Front->dispatch() #3 {main} thrown in G:\Strony\zend\library\Zend\Controller\Dispatcher\ Standard.php on line 295
IndexController.php

PHP Code:
<?php
class IndexController extends Zend_Controller_Action {
   function 
indexAction() {
      echo 
"<p>in IndexController::indexAction()</p>";
      die;
   }

   function 
addAction() {
      echo 
"<p>in IndexController::addAction()</p>";
      echo 
"<p>in IndexController::indexAction()</p>";
      die;
   }

   function 
editAction() {
      echo 
"<p>in IndexController::editAction()</p>"; die;
   }

   function 
deleteAction() {
      echo 
"<p>in IndexController::deleteAction()</p>"; die;
   }
}
?>
i use ZF v. 1.0.4
Apache 2 on win vista
and PHP 5.2.4

Last edited by kociou : 03-09-2008 at 09:56 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-10-2008, 01:06 AM
Junior Member
 
Join Date: Feb 2008
Posts: 18
Default

Code:
<?php

error_reporting(E_ALL);
ini_set('display_errors', 'on');
ini_set('include_path', ini_get('include_path') .';./includes;./application/models');

date_default_timezone_set('Europe/London');

// Load the Zend, become zen..
require 'Zend/Loader.php';

// Save resources
/*Zend_Loader::loadClass('Zend_YOUROPTION'); */
Zend_Loader::registerAutoload();

$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory(array(
	'default'       => 'application/controllers',

));

$front->throwExceptions(true);


$front->dispatch();
?>
That should work, it's from the screencast by mitchell.

or just try rechecking your init_set include_path
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-11-2008, 09:57 PM
Junior Member
 
Join Date: Mar 2008
Posts: 4
Default

it's don't work - i'v still the same error...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-12-2008, 02:29 PM
xentek's Avatar
Senior Member
 
Join Date: Feb 2008
Posts: 112
Default

Try taking out the die statements.
__________________
- xentek
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-15-2008, 12:32 AM
Junior Member
 
Join Date: Mar 2008
Posts: 4
Default

Quote:
Originally Posted by xentek View Post
Try taking out the die statements.
not working...

but on the web (apache2 on debian ZF v. 1.0.4 and PHP 5.2.4) it works
php.ini on debian and vista are almost the same

Last edited by kociou : 03-15-2008 at 12:38 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-15-2008, 01:38 PM
Junior Member
 
Join Date: Feb 2008
Posts: 18
Default

Quote:
Originally Posted by kociou View Post
not working...

but on the web (apache2 on debian ZF v. 1.0.4 and PHP 5.2.4) it works
php.ini on debian and vista are almost the same
Is it throwing any (different) messages?

Last edited by David : 03-15-2008 at 01:44 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 03-15-2008, 11:13 PM
Junior Member
 
Join Date: Mar 2008
Posts: 4
Default

Quote:
Originally Posted by David View Post
Is it throwing any (different) messages?
no - on the web just print "in IndexController::indexAction()"
on local is 'Cannot load controller class "IndexController"' error
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 03-21-2008, 03:56 PM
Junior Member
 
Join Date: Mar 2008
Posts: 1
Default

Hi!

I just had the same problem, got the same message. Just that it worked on my windows platform, and got the error message on linux server.
I don't really know what the message means, because it doesn't mean that the file cannot be found.
I was using Zend FR 1.5.0.rc, so i updated to the lastest, stable 1.5.0 release. This way i got another warning, that the file cannot be found.
It was an include path problem. (i had to add the "." as include path in vhosts.conf)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 03-26-2008, 12:49 PM
Junior Member
 
Join Date: Feb 2008
Posts: 18
Default

I really recommend if you would go to Nabble - Zend Framework Community forum

the mailing list would probably solve it... since the this forum is still growing =/
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 01:46 AM.