Setting Up Zend Framework

So it is time to check out Zend Framework seeing how powerful everyone says it is. Setup is a bit annoying in comparison to other “funner” frameworks so I am going to document my findings as I learn. Here’s a guide to getting ZF working on your *nix dev box.

Setting up your environment

Using a SSH client such as Putty – connect to your web server and create a directory in your users home named “bin”

$ cd ~
$ mkdir bin
$ cd bin

Next we need to download a stable copy of Zend Framework via subversion using the following command :

$ svn checkout

If svn (Subversion) is not installed you can download via wget using the following command :

$ wget

Next we need to untar (decompress) the framework :

$ tar -zxvf ZendFramework-1.10.3-minimal.tar.gz

Rename the decompressed folder :

$ mv ZendFramework-1.10.3-minimal Zend

** Note if you used subversion to acquire Zend Framework – you probably have downloaded the release directory – use the command above replacing the first argument with the release directory name.

Move the scripts from the Zend/bin directory into the ~/bin directory; make them executable; rename to just zf (for simplicity) :

$ mv Zend/bin/* .
$ chmod +x
$ mv zf

The next step is to add the zf script to the users include path, this allows us to use the zf command without having to specify the absolute path. Copy and paste the next 6 lines into your shell :

cat << EOF >> ~/.bashrc
if [ -d ~/bin ] ; then
export PATH

You must now log out and back in to activate this path. Once you are logged back in you can test the zf command by typing :

$ zf show version

If you see “Zend Framework Version: 1.10.3″ you are ready to start your first project.