This tutorial will cover in a few steps how to create a base skeleton application using Zend Framework 1.X,
useful as startup for your new web-based project.
What you need
In order to start with this tutorial you need the following
- Windows OS I used Windows Seven
- Wamp Environment to use your local machine as a Web Server you need Php and Apache installed on your local machine, to do so the simpler thing is to download and install
Wamp Server OR Xampp OR any other application that install the full environment.
I’ve made this tutorial with Wamp Server installed on my local machine. - Zend Framework latest release of 1.X branch, please visit download section of Zend Framework website.
For this tutorial you can download the minimal release as we don’t need any other files than the framework itself.
Setting up Your Environment
At this point I will assume you have the environment and text editor installed and latest minimal Zend Framework 1.X release downloaded, so now follow these steps
- Create a directory named “ZendFrameworkCli” in your “Program Files” folder. So now you will have “C:\Program Files\ZendFrameworkCli” on your local machine.
- Extract the content of the downloaded Zend Framework archive, you should have two directories named ‘bin’ and ‘library’, copy them both to the location “C:\Program Files\ZendFrameworkCli”:
you will now have “C:\Program Files\ZendFrameworkCli\bin” and “C:\Program Files\ZendFrameworkCli\library” on your local machine. - Now we need to edit the “Path” environment variable adding two paths, why? Because later we need to call ZF and PHP commands from the shell so it will not be necessary to provide the full path. ZF command is provided by the Zend_Tool component.On Windows Control Panel ( Start -> Control Panel ) double click on “System” icon, then, on the new window, click on “Advanced System Settings”
( label may vary ) and then click on the button “environment variables”. Find the variable “Path” in the lower box and click the “Edit” button.At the end of the string value add “;C:\Program Files\ZendFrameworkCli\bin” without quotes.
Now, depends of the application you used to install the Web Server environment, add the PHP executable path, for example “;C:\wamp\bin\php\php5.2.9-2″ in case you user Wamp Server or
“C:\xampp\php” in case you used Xampp. Make sure to add the correct path where the php executable resides.Pay attention to the leading semicolon “;” for each new value, this is very important as ends the last path string of the “Path” environment variable value.
You will now have to press the “OK” button on all opened windows (three times).
- Restart your computer and remember to turn on the web server.
Generation of a New Project
Open the shell ( Start menu, write “cmd” and press “enter” ), write “zf show version”, if everything goes fine it will answer with
the version of the ZF you previously downloaded, for example “Zend Framework Version: 1.11.11″.
To create a new empty project write “zf create project {PATH/TO/PROJECT/}{PROJECT-NAME}” where {PATH/TO/PROJECT/} is the destination of the new project
and {PROJECT-NAME} is the name of the directory containing the new project.
If the path is not provided the project will be created inside the current directory.
Try to type “zf create project C:/zfproject” to create it on C.
Make it Works
Place the new created project in your document root, eg. “C:\wamp\www” for Wamp Server users. Now you should have “C:\wamp\www\zfproject”.
Please note that the generated project comes without Zend Framework’s library inside, so we have to place the Zend library within it,
we need to make a copy of “C:\Program Files\ZendFrameworkCli\library\Zend” in “C:\wamp\www\zfproject\library\Zend”. After that we can call the address “http://localhost/zfproject/public”
and, if everything goes fine you must see this screen:


(1 votes, average: 4.00 out of 5)
Pingback: Zend Framework Project Generation on WAMP | Sergio Rinaudo - EtondeGroup Blog of Web Applications | EtondeGroup Blog of Web Applications
This post was really helpful, it took 2 minutes to set up the ‘environment’!!!
Thanks, very helpful
I have successful installed the Zend Framework and wamp.
But it is not run on browser, a message occur ” Internal Server Error “.
Do you have the .htaccess file correcly configured? Do you have enabled apache rewrite module?
Let me know.
Cheers