Archive for the ‘ Zend Framework ’ Category

Setting up zend framework on ubuntu server


Now i am going to install the Zend Framework. Download the most recent version from the Zend Framework website and extract it to the /opt folder.

To enable us to easily switch out different versions, we will create a symbolic link to this folder (just right click and select the ‘Make link’ option and name it ‘zend’ and place it to your favourite location in my case I placed it to /var/www/ )

Next, we will tell php to include the zend framework in the include_path.


sudo gedit /etc/php5/apache2/php.ini

Add/Change the include_path in to :


include_path = ".:/var/www/zend/library"

Note that I used the symbolic link in the include path.. This way, when there is a new version of ZF, we can just switch out the symlink without having to edit the ini file!

In order to use the zend framework command line tool (/var/www/zend/bin/zf.sh), we need to install the php command line interface (php5-cli).


sudo apt-get install php5-cli

Note that the CLI uses a different version of the php.ini file (NOT the one in the apache2 folder but in the cli folder!). We need to tell CLI also where the zend framework directory is located.


sudo gedit /etc/php5/cli/php.ini

and set:


include_path = ".:/var/www/zend/library"

The final step is to include the path to /opt/Zend/bin in the unix PATH variable (this way, you can use zf.sh instead of /var/www/ zend/bin/zf.sh). use the following command .

sudo gedit ~/.bashrc

Add the following line at the end:


PATH=/var/www/zend/bin:”${PATH}”

The Zend Framework relies on the apache “rewrite” module. So, go ahead and enable the “rewrite” module using the following command:


sudo a2enmod rewrite

Restart apache..


sudo /etc/init.d/apache2 restart

and you should be all set