Monday, November 29, 2010

setting up zend framework on ubuntu

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.. name it ‘Zend’)















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 = “.:/opt/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 (/opt/Zend/bin/zf.sh), we need to install the php command line interface (php5-cli) if it is not already installed.
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 = “.:/opt/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 /opt/Zend/bin/zf.sh). Edit file named ~/.bashrc (ctrl+h show hidden files). Add the following line at the end:
PATH=/opt/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 and that should be it.

3 comments:

owen said...

how do you take ownership of the /var/www/ directory? I've always wanted to do that

Jerome Bailey said...

you can do two things, one is not recommended though.

1. change the permission of the folder. you can do this by this command in the terminal:
sudo chmod -R 777 /var/www/
this will prompt you for your password.
To break down the command:

sudo - gives root access
chmod - changes permission on files/folders
-R - flag. It means recursive into folders
777 - permission. Read Write Execute for Owner, Group Others. So, Owner can read write execute and so does group and others
/var/www/ - path to execute the command on

2. go to terminal and run this command to have complete access to nautilus:
sudo nautilus

owen said...

ah will try that