Installing & Creating Zend framework project with zf tool

OK so I think I want to make it much clear from other guides that I found. So lets just get started:

Open your command line (on windows use *cmd,on linux use your terminal*). Note: don't forget that you need web server. you can make it by your self or use WAMP (Windows), LAMP (Linux) or MAMP (Mac).

There are few ways to install Zend Framework:

Download as a Linux distribution package:

  • sudo aptitude install zendframework 
  • sudo apt-get install zendframework 
  • sudo yum install zendframework[As far as I know, Remi's repository is up-to-date]

You may install Zend Framework by your self, which is good practice, though you don't have to.

  • First download Zend Framework
  • Unpack tar.gz zip
  • Add your Zend Framework library to OS's PATH. [Windows Linux]
  • My recommendation is to copy Zend Framework library to your PHP library
  • Add Zend Framework to include_path on php.ini [When adding your path note path's slash. On Windows use "" and on Linux use "/"]. Read more about ZF & include_path
  • If you have problems with ZF tool, please read this

Lets create our project: zf create project /path/to/project/ [NAME-OF-PROFILE] [FILE-OF-PROFILE]. Our project will be skoproject: zf create project /var/www/html/skoproject/ skoproject

Its very important to remember that you need to add "PROJECTNAME" to your path. if you forget and then you'll try to create another project you may see the following error msg:

 An Error Has Occurred
 A project already exists here

If you want to fix this problem, you'll have to remove .zfproject.xml. You can find this file by using find /path/to/project -name '.zfproject.xml'and then delete it with  rm -rf /path/to/project/.zfproject.xmlanother optional solution may be found here

Till now we have a working project, as you may see it on your webserver path, e.g: http://localhost/skoproject/ Zend Framework - Welcome

Next, we will create our inside project, including Models, Controllers, Modules and everything that we need for understanding how Zend framework works.