title: Zend MVC - get rid of public folder
body: <p>All,
  My PHP Zend MVC Application structure is like this:</p>
  
  <pre><code>billingsystem
   -application
   -design
   -public
      --index.php
      --.htaccess
   -library
      -- Zend
  </code></pre>
  
  <p>whenever the application loads, it goes to index.php in public folder and it gets rerouted from there.. I want to make sure users to access the system by going <a href="http://billingsystem/" rel="nofollow noreferrer">http://billingsystem/</a>  instead of going to <a href="http://billingsystem/public" rel="nofollow noreferrer">http://billingsystem/public</a>. Is this a Zend convention to keep the public folder. or can I get rid of it and move the files to the root directory? I tried doing this, but my application failed miserably, as it's not able to find the Zend library and load it's classes.. Some of my index.php code is as under:</p>
  
  <pre><code>// Define path to application directory
  defined('APPLICATION_PATH')
      || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
  
  // Ensure library/ is on include_path
  set_include_path(implode(PATH_SEPARATOR, array(
      realpath(APPLICATION_PATH . '/../library'),
      get_include_path(),
  )));
  
  // Ensure include/ is on include_path
  set_include_path(implode(PATH_SEPARATOR, array(
      realpath(APPLICATION_PATH . '/../include'),
      get_include_path(),
  )));
  
  // Ensure application/models is on include_path
  set_include_path(implode(PATH_SEPARATOR, array(
      realpath(APPLICATION_PATH . '/../application/models'),
      get_include_path(),
  )));
  
  /** Zend_Application */
  require_once 'Zend/Application.php';
  require_once 'Zend/Loader.php';
  
  //Autoload Zend Classes
  Zend_Loader::loadClass('Zend_Loader_Autoloader');
  Zend_Loader_Autoloader::getInstance()-&gt;setFallbackAutoloader(true);
  </code></pre>
  
  <p>Thanks</p>