This was surprisingly tricky to figure out, although that points more to the smoothness of setting up an application when it’s living in the site root. Sorry for the brevity here, this one is here mainly for my own reference but as it may help you out of a jam I thought I’d share.
- Follow the Quickstart Instructions over at the manual page, using the zf command line tool to create your application outside the webroot. I like to create a folder called
ZendApplications
that lives next to my ZendFramework folder - Rename/mv the
public
folder to whatever subdirectory off your site root you want your Zend Application to live (the titular Subdirectory) -
Change the .htaccess file created by the
zf
tool so it has aRewriteBase /subdirectory-name
-
Tangential, but make sure your index.php page has your ZendFramwork library in its page. If you don’t want to add it to your php.ini, you can add it in with
ini_set('include_path', ini_get('include_path') .
':/path/to/ZendFramework/library'); -
Also in index.php, change the application path from
realpath(dirname(__FILE__) . '/../application'
to the folder where you created your project
/path/to/ZendApplications/application-name/application
This hasn’t been tested extensively, there may be other path assumptions that the Framework or Zend_Tool
makes, so use it at your own risk.