Ok, this is my first tutorial in english, then sorry if my english is not more good
Few months ago, I started to know the Zend Framework (aka ZF), a library of PHP classes and components created by Zend. Despite its complexity, relactive to others frameworks, I chose this for several aspects, but mainly because I think it is the only one framework that has a future; Zend is the PHP’s company and is not possible that Zend will close the project.
At the time of writing, the last release is 1.8.3. With 1.8 have been introduced changes especially in the initial part of the creation of a project, and a very usefuf tool was integrated (Zend_Tool), wich allows us to initialize the project via shell. I tried it and it’s very useful!

Now we will see how to use Zend Tool. I use a test environment using a distribution of Debian in one of our web server, but can also be used on Windows and Mac.
Configuring PHP and Zend Framework
First, we must download the Zend Framework from http://framework.zend.com/download/latest, then:
[code lang="plain"]dev:~# wget http://framework.zend.com/releases/ZendFramework-1.8.3/ZendFramework-1.8.3.tar.gz
dev:~# tar zxvf ZendFramework-1.8.3.tar.gz
dev:~# cd ZendFramework-1.8.3[/code]
(change the version number with the actual or your version)
I decide to move the “ZendFramework” directory in /var/www, that isn’t the documentroot of Apache, because I have configured the Virtual Hosts. You can decide where move or copy the directory.
PHP allows you to set the “includes” directory, ie each time that a script uses the command include or require, PHP checks the directory of current script in the directories set with the include_path directive.
Then configure the php.ini in /etc/php5/cli and /etc/php5/apache2 (the first is the configuration that typically uses the shell, the second is that it uses the PHP used as a module in Apache 2):
[code lang="plain"]dev:~# nano /etc/php5/cli/php.ini
<pre>dev:~# nano /etc/php5/apache2/php.ini[/code]
and we have the following directives: safe_mode_include_dir and include_path including the path of the ZendFramework library:
[code lang="plain"]safe_mode_include_dir = ".:/var/www/ZendFramework/library"
include_path = ".:/var/www/ZendFramework/library"[/code]
Well, the ZendFramework is installed in our server, now we’ll install Zend Tool.
Installing Zend_Tool
Now, we must confoguring Zend Tool, so:
[code lang="plain"]dev:~# chmod 770 /var/www/ZendFramework/bin/zf.sh
dev:~# ln -s /var/www/ZendFramework/bin/zf.sh /bin/zf
dev:~# zf show version
Zend Framework Version: 1.8.3[/code]
Now everything should be ok! If you did everything right you should see something similar to the above. Now type:
[code lang="plain"]dev:~# zf ?[/code]
You should see a little guide with the available commands.
Next time I will explain how to create a basic project.