To generate an empty project shell using the Zend Framework is pretty easy thanks to the powerful zf command line utility.

To create a project, simply open a command line window, browse to the directory in which you want to create your Zend Framework project and enter:

zf create project "My Project"

zend-zf-logowhere My Project is the name of the project you want to generate. Note that for project names containing spaces, you can make use of double quotes to enclose. Also, zf (or rather the Zend bin directory) should be added to your system PATH in order to give it global visibility and thus make it easier to use.

The program will create a directory matching the name of your given project, and populate it with all the necessary Zend shell structures. You should at a minimum have application, docs, library, public and tests folders in the root, as well as a .zfproject.xml file. In the public folder, check that there is a .htaccess file containing the following rules:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

Finally, you need to either symlink the library folder to that of the installed Zend framework’s library folder on the system, or just copy the Zend framework library folder’s contents into the library folder of your new project directory.

Done.