If you already have a web development environment set up on your machine and don’t necessarily want to run the whole Zend Server package and instead just want to create Zend projects using the Zend Framework, then this simple how to install Zend Framework tutorial should be perfect for you.

Step 1) Grab Zend Framework

Download the latest version of the framework from http://framework.zend.com/download/latest and unzip it to where you want it installed/located on your machine.

Step 2) Set up System PATH Variable

Add the newly extracted Zend Framework package to your system PATH variable: In VISTA right click on the Computer (My Computer) icon and click on the Advanced System Settings link under the tasks menu on the left. At the bottom of the resulting System Properties dialog will be a button that reads Environment Variables. Click this.

Browse through the list of Variables under the System variables section of the Environment Variables dialog. If you already have a PATH variable, click Edit. If you don’t click on New. Variable name should be set to PATH. The value should be set to the folder in which you extracted the framework: e.g. C:ZendFramework-1.11.4bin

Note that while you are here, you may as well check if your PHP bin directory (basically the directory containing php.exe) is listed under the PATH variable. If not, add it. Mulitple locations can be defined under the PATH variable, using semi-colon ‘;’ to delimit them: e.g. C:ZendFramework-1.11.4bin;C:xamppphp

To test that this has been done correctly, open a command prompt (Windows button->Run…->cmd) and type in zf. If it complains about zf not being an executable, then your path setting is wrong. If it works, you’ll get some help information from the zf command.

Step 3) Generate Zend project

Now to generate your Zend project. Still in the command prompt, browse to where you want to create your project: e.g. cd c:vhostszend-projects. Now, enter:

zf create project MyProjectName

where MyProjectName is the name of your Zend project. This should generate a folder structure under c:vhostszend-projectsMyProjectName that will contain all the necessary Zend folder/file structures necessary for your work. For example, you should see folders under the root like application, library and public.

Note that sometimes this process doesn’t properly generate the necessary library contents. To get around this, go to the folder in which you originally extracted the Zend Framework to, locate the library folder in its root and copy its contents to the library folder under your project’s root.

Step 4) Set up Virtual Host

Locate your Apache2 httpd-vhosts.conf file. If it isn’t using a separate file to maintain its list of virtual hosts, then locate its httpd.conf file. In it, you need to add the virtual host information for your new project. Locate the section dealing with virtual hosts and add the following:

<VirtualHost *:80>
DocumentRoot c:/vhosts/zend-projects/MyProjectName/public
ServerName  MyProjectName
<Directory "c:/vhosts/zend-projects/MyProjectName/public/">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all

Save your .conf file and restart Apache2.

Step 5) Edit Your hosts File

Finally, we just need to edit our Windows host file so that we can work on our project. Locate and open in notepad (PSPad is my favourite) C:windowssystem32driversetchosts. Add the following line and save: MyProjectName

Step 6) Test Installation

And we’re done. If you now hit http://MyProjectName/ from a browser you should be presented with a Zend Welcome splash page. (If you are presented with a failed to open stream error, remember the library contents note I made in step 3.)

Nifty – or should that rather be, Good Luck!? :)