views:

62

answers:

4

I don't have permission to change the document root the /public/ directory so how should I set up my Zend Framework application to run from the current root directory? Using the Zend Framework 1.8 command line tool, I don't know if there is a way to tell it to create a directory structure this way.

A: 

The simplest way without changing a lot of configuration, is to put everything in the public folder you mention into your public_html folder, then place all the other contents, like the application, and library folders into the directory up from public_html.

You can also throw everything into your public_html folder, although that is not recommended. Each class has options to provide a different path. For example on the Front_Controller, you can set the Controllers directory to wherever you want. There are options to specify different paths, but if you follow convention it is done for you.

Kekoa
+2  A: 

If you can access only the upper level of web (i.e. - public), you should set index there and the whole application folder too. Create a .htaccess with Deny from all And put it into your /application.

Your configuration will be:

/application
/library
index.php
Tomáš Fejfar
A: 

Just use the quickstart guide and adjust according to it. Zend_Tool is still experimental anyway. Let me know if this helps.

Till
A: 

So here's what I ended up doing:

  1. Download the Quickstart sample code.
  2. Move everything in public up to the main directory, along side application, library directories.
  3. Alter include paths to library and application in index.php to point to the correct locations
  4. I think that was all I had to do. ZF new how to the rest.

I don't think this is ideal however, as already mentioned, application directory becomes accessible from the web, but for now, it's getting the job done.

Andrew