How to Initialize a Zend Project on wamp March 28, 2011Posted by Tournas Dimitrios in Zend Framework v1.10.
The Zend Framework is an open source framework for developing web applications and services with PHP5 , based on simplicity , object-oriented best practices , corporate friendly licensing and a robust well-tested code base . This article is just a quick how-to initialize a Zend project from the terminal window on a Windows XP box . I assume that you already have an PHP / Mysql development environment on your local machine , for example Wamp .
First download the latest Zend Framework to your development environment . Visit the official Zend Framework Web site and get a copy of the most recent release of the software ( v. 1.11) . Zend Technologies makes two versions of the package available :
- A minimal version , which contains just the standard libraries and command-line tools
- A full version , which contains additional documentation , examples , unit tests and third-party toolkits . I recommend the full version .
Once you’ve downloaded the code archive , extract its contents to a directory of your file system , let’s say “C:\my_php” . You should end up with a directory structure that contains the libraries , demo , bin and documentation . The library directory contains all the Zend Framework components , while the bin/ directory contains command-line tools that are helpful in initializing a new project and adding objects to it .Two important things has to be done :
- The library/ directory should be set as an reference in your PHP include path list in the php.ini file . Open you php.ini file and find the directive include_path , now append your Zend’s library/ directory [include_path = “.;c:\php\includes;C:\my_php”] . Restart your Wamp server .
- The bin/ directory should be set in the computer’s executable path .
Right click “my computer icon ” -> properties ->advanced -> Environment Variables -> System Variable window select “Path” -> edit -> at the end of the line append the location of your Zend bin/ directory ” ;C:\my-PHP\Zend\bin ” . The semicolon must be included .
- Enable “rewrite ” directive on httpd.conf file ( un -comment by removing the “# “)
LoadModule rewrite_module modules/mod_rewrite.so
- A good practice is to apply virtual hosts on your development environment
The bin/ directory contains three scripts : zf.sh , the command -line interface for Linux ; zf.bat , the command -line interface for Windows ; and zf.php the main “worker” script .
You are almost there !!! . Open a terminal window and move to your web’s root directory
- cd C:\Program Files\wamp\www\
- zf create project test-project
That’s it , your web’s root contains a Zend project with the name of “test-project ” . Navigate with your browser to : http://localhost/test-project/public/