title: require_once(Zend/Application.php): failed to open stream when using zend framework
body: <p>I am a new user to zend framework and i tried the other solutions given in stack overflow for similar questions. </p>
  
  <p>This is my index.php</p>
  
  <pre><code>&lt;?php
  date_default_timezone_set('UTC');
  // Define path to application directory
  defined('APPLICATION_PATH')
      || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
  
  // Define application environment
  defined('APPLICATION_ENV')
      || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
  
  
  // Ensure library/ is on include_path
  set_include_path(implode(PATH_SEPARATOR, array(
      realpath(APPLICATION_PATH . '/library'),
      get_include_path(),
  )));
  
  
  /** Zend_Application */
  require_once 'Zend/Application.php';
  
  // Create application, bootstrap, and run
  $application = new Zend_Application(
      APPLICATION_ENV,
      APPLICATION_PATH . '/configs/application.ini'
  );
  $application-&gt;bootstrap()
              -&gt;run(); 
  </code></pre>
  
  <p>When i echo set_include_path, this is the response i got, </p>
  
  <p><strong>:.:/usr/lib64/php</strong></p>
  
  <p>Do i have to install zend framework in my new Cent OS ?</p>
  
  <p>My library folder is, in the same directory the index.php reside.</p>
  
  <p><strong>/home/eat/public_html/index.php
  /home/eat/public_html/library
  /home/eat/public_html/library/Zend</strong></p>
  
  <p>Update..</p>
  
  <p>When i hardcoded the path as, set_include_path('/home/eat/public_html/library/');</p>
  
  <p>I started getting a new error. which is, </p>
  
  <pre><code>    Warning: require_once(Zend/Loader/Autoloader.php): failed to open stream: No such file or directory in /home/eat/public_html/library/Zend/Application.php on line 80
  
      Fatal error: require_once(): Failed opening required 'Zend/Loader/Autoloader.php' (include_path='/home/eat/public_html/library/') in /home/eat/public_html/library/Zend/Application.php on line 80
  
  **Update 2**
  
  Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'Resource matching "multidb" not found' in /home/eat/public_html/library/Zend/Application/Bootstrap/BootstrapAbstract.php:691 Stack trace: #0 /home/eat/public_html/library/Zend/Application/Bootstrap/BootstrapAbstract.php(626): Zend_Application_Bootstrap_BootstrapAbstract-&gt;_executeResource('multidb') #1 /home/eat/public_html/library/Zend/Application/Bootstrap/BootstrapAbstract.php(583): Zend_Application_Bootstrap_BootstrapAbstract-&gt;_bootstrap('multidb') #2 /home/eat/public_html/application/Bootstrap.php(58): Zend_Application_Bootstrap_BootstrapAbstract-&gt;bootstrap('multidb') #3 /home/eat/public_html/library/Zend/Application/Bootstrap/BootstrapAbstract.php(666): Bootstrap-&gt;_initApplication() #4 /home/eat/public_html/library/Zend/Application/Bootstrap/BootstrapAbstract.php(619): Zend_Application_Bootstrap_BootstrapAbstract-&gt;_executeResource('application') #5 /home/eat/public_html/library/Zend/Application/Bootstrap/BootstrapAbstract.php(583): Z in /home/eat/public_html/library/Zend/Application/Bootstrap/BootstrapAbstract.php on line 691
  </code></pre>
  
  <p><strong>Application.ini</strong></p>
  
  <pre><code>[production]
  phpSettings.display_startup_errors = 1
  phpSettings.display_errors = 1
  resources.frontController.params.displayExceptions = 1
  
  eat.application.base.url = "eat.com"
  eat.application.admin.url = "admin.eat.com"
  eat.application.api.url = "api.eat.com"
  
  includePaths.library = APPLICATION_PATH "/../library"
  bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
  bootstrap.class = "Bootstrap"
  appnamespace = "Application"
  resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
  resources.frontController.params.prefixDefaultModule = "1"
  
  resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
  
  autoloaderNamespaces[] = "Eat_"
  
  resources.modules = ""
  
  phpSettings.date.timezone = "GMT"
  
  eat.application.salt = "sd876fs89df";
  resources.view[] =
  resources.view.helperPath.Eat_View_Helper = APPLICATION_PATH "/../library/Eat/View/Helper"
  
  ;;; Databases
  
  
  ;;;;; Layouts
  
  resources.layout.layoutPath = APPLICATION_PATH "/views/layouts"
  resources.layout.layout = web/web
  
  nexva.applicaiton.fileUploadDirectory = APPLICATION_PATH "/../files"
  
  ;;;; ReCaptcha ;;;;
  recaptcha.private_key = 6LfL7rsSAAAAAKgtKWsMk4hmA2DSVq0ODcyJFRjs
  recaptcha.public_key = 6LfL7rsSAAAAANiaZOQN7LOoCGAXh29rHTZPRoVa
  
  [staging : production]
  eat.application.base.url = "eat.com"
  eat.application.admin.url = "admin.eat.com"
  eat.application.api.url = "api.eat.com"
  
  ;;; Databases
  resources.multidb.default.adapter       = mysqli
  resources.multidb.default.host          = "localhost"
  resources.multidb.default.username      = "eat"
  resources.multidb.default.password      = "eat"
  resources.multidb.default.dbname        = "eat_main"
  resources.multidb.default.default       = true
  
  [development : production]
  eat.application.base.url = "eat.com"
  eat.application.admin.url = "admin.eat.com"
  eat.application.api.url = "api.eat.com"
  
  ;;; Databases
  resources.multidb.default.adapter       = mysqli
  ;resources.multidb.default.host          = "192.168.1.253"
  resources.multidb.default.host            = "localhost"
  resources.multidb.default.username      = "eat"
  resources.multidb.default.password      = "eat"
  resources.multidb.default.dbname        = "eat_main"
  resources.multidb.default.default       = true
  
  [development-alt : development]
  </code></pre>
  
  <p><strong>Update 3</strong></p>
  
  <pre><code>&lt;?php
  
  class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
  {
      public function __construct($application)
      {
          parent::__construct($application);
      }
  
      protected function _initAutoload()
      {
  
          Zend_Controller_Action_HelperBroker::addPrefix('Eat_Controller_Action_Helper');
  
      $autoloader = new Zend_Application_Module_Autoloader(
              array(
                'namespace' =&gt; '',
                'basePath' =&gt; APPLICATION_PATH,
                'resourceTypes' =&gt; array(
                  'form' =&gt; array(
                    'path' =&gt; 'forms',
                    'namespace' =&gt; 'Form',
                  ),
                  'model' =&gt; array(
                    'path' =&gt; 'models',
                    'namespace' =&gt; 'Model',
                  ),
                )
              )
      );
  
      return $autoloader;
    }
  
  
  
    protected function _initLayoutHelper()
    {
      $this-&gt;bootstrap('frontController');
  
      $layout = Zend_Controller_Action_HelperBroker::addHelper(new Eat_Controller_Action_Helper_LayoutLoader());
  
    }
  
    protected function _initApplication()
    {
  
      $config = new Zend_Config_Ini(APPLICATION_PATH . "/configs/application.ini", APPLICATION_ENV);
      Zend_Registry::set("config", $config);
  
  
      $locale = new Zend_Locale();
      Zend_Registry::set('Zend_Locale', $locale);
  
      //init DB connection
      try {
  
          $this-&gt;bootstrap('multidb');
          $multiDb = $this-&gt;getPluginResource('multidb');
  
          $db = $multiDb-&gt;getDb('default');
          $db-&gt;setFetchMode(Zend_Db::FETCH_OBJ);
          $db-&gt;getConnection();
          $db-&gt;getProfiler()-&gt;setEnabled(true);
  
          Zend_Registry::set('db', $db);
  
           //Just making everything UTF8. This is a hack, need to find the proper Zend way
          $db     = Zend_Registry::get('db');
          $db-&gt;query('SET NAMES "utf8"')-&gt;execute();
  
  
      } catch (Zend_Db_Adapter_Exception $e) {
  
          die("Error connecting to database: " . $e-&gt;getMessage());
  
      }
  
  
    }
  
    public function _initRoutes()
    {
      /*
      $router = Zend_Controller_Front::getInstance()-&gt;getRouter();
      $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routes.ini', APPLICATION_ENV);
      $router-&gt;addConfig($config, 'resources');
  
  
      $routes['featured'] = new Zend_Controller_Router_Route(
              'featured/:id',
              array('controller' =&gt; 'index', 'action' =&gt; 'featured', 'id' =&gt; null)
      );
  
      Zend_Controller_Front::getInstance()-&gt;getRouter()-&gt;addRoutes($routes);
      */
    }
  
  
      protected function _initLanguages()
      {
  
  
      }
  
  
      //Initilaize zend ACL
      public function _initAcl()
      {
          //Omit the process in CLI mode
          if (php_sapi_name() != 'cli')
          {
              $helper = new Eat_Controller_Action_Helper_AclDefault();
              $helper-&gt;setRoles();
              $helper-&gt;setResources();
              $helper-&gt;setPrivilages();
              $helper-&gt;setAcl();
  
              //Register the ACL plugin - Then it will be called automatically,whenever an acion is called
              $this-&gt;bootstrap('frontController');
              $frontController = Zend_Controller_Front::getInstance();
         // $frontController-&gt;registerPlugin(new Eat_Plugin_Acl());
  
  
          }
      }
  
      //Initialize error controller
      public function _initErrorSwitcher()
      {
          $this-&gt;bootstrap('frontController');
          $frontController = Zend_Controller_Front::getInstance();
          $frontController-&gt;registerPlugin(new Eat_Plugin_ErrorControllerSwitcher());
      }
  
      protected function _initZFDebug()
      {
          //  Enabling this method seems to break autocomplete. Use only when needed
          $autoloader = Zend_Loader_Autoloader::getInstance ();
          $autoloader-&gt;registerNamespace ( 'ZFDebug' );
  
          $db = Zend_Registry::get ( 'db' );
  
          $cache = Zend_Cache::factory ( 'Core', 'File' );
  
          //Zend_Controller_Front::getInstance()-&gt;getBaseUrl();
          //APPLICATION_PATH
          $options = array ('plugins' =&gt; array ('Variables', 'Database' =&gt; array ('adapter' =&gt; $db ), 'File' =&gt; array ('basePath' =&gt; Zend_Controller_Front::getInstance ()-&gt;getBaseUrl () ), 'Memory', 'Time', 'Registry', 'Cache' =&gt; array ('backend' =&gt; $cache-&gt;getBackend () ), 'Exception' ) );
  
          $debug = new ZFDebug_Controller_Plugin_Debug ( $options );
  
          $this-&gt;bootstrap ( 'frontController' );
          $frontController = $this-&gt;getResource ( 'frontController' );
          //$frontController-&gt;registerPlugin ( $debug );
  
  
      }
  
  
  
  
  
  
  }
  </code></pre>