I get this Fatal Error:

Fatal error: Uncaught exception 'Zend_Controller_Exception' with message 'Directory "/home/specorg/application/controllers/IndexController.php" not found or not readable' in /home/specorg/Zend/Controller/Front.php:224 Stack trace: #0 /home/specorg/Zend/Controller/Front.php(247): Zend_Controller_Front->addControllerDirectory('/home/specorg/a...', 0) #1 /home/specorg/Zend/Controller/Front.php(201): Zend_Controller_Front->setControllerDirectory('/home/specorg/a...') #2 /home/specorg/public_html/index.php(8): Zend_Controller_Front::run('/home/specorg/a...') #3 {main} thrown in /home/specorg/Zend/Controller/Front.php on line 224

How can this be possible with this code:

<?php
  ini_set('include_path', '.:/home/specorg');
  require_once('Zend/Controller/Front.php');

  $indexController = '/home/specorg/application/controllers/IndexController.php';

  if(is_file($indexController) && is_readable($indexController))
    Zend_Controller_Front::run($indexController);
  else
    echo $indexController . ' is not a file!';
?>

???

I am working from http://framework.zend.com/manual/en/zend.controller.html#zend.controller.quickstart.go

TIA!

    Hi,

    The static run method in zend front controller expects a directory path, not an absolute path to an action/controller.

    Try the following:

    <?php
      ini_set('include_path', '.:/home/specorg');
      require_once('Zend/Controller/Front.php');
    
      $controllerPath = '/home/specorg/application/controllers';
      try {
        Zend_Controller_Front::run($controllerPath);
      } catch (Zend_Controller_Exception $e) {
         echo $e->getMessage();
      } 
    ?>
    

    HTH.

    Regards,

      Thanks, I will give that a try!

        Worked perfectly.

        Thanks again. 🙂

          Write a Reply...