Installation of Zend Framework @ Ubuntu

I’m currently working with the YouTube API for some webprojects, and this is using the Zend Framework. Therefore will I make this little guide, and show how to install the Zend Framework on Ubuntu.

In this guide I’ll be using the following:

  • Ubuntu Server 11.10
  • Zend Framework latest Library as 1.11.11. Download it form here.

First of, download the Zend Framework with wget:

mz@marcz:~$ wget http://framework.zend.com/releases/ZendFramework-1.11.11/ZendFramework-1.11.11.tar.gz

After the download is complete, its time to extract it. I’ll extract it to /usr/local.

mz@marcz:~$ sudo cp ZendFramework-1.11.11.tar.gz /usr/local
[sudo] password for mz:
mz@marcz:~$ cd /usr/local/
mz@marcz:/usr/local$ sudo tar -xzvf ZendFramework-1.11.11.tar.gz

Then rename the folder to ZendFramework

mz@marcz:/usr/local$ sudo mv ZendFramework-1.11.11 ZendFramework

Now set the right permissions:

mz@marcz:/usr/local$ sudo chmod 0755 ZendFramework
mz@marcz:/usr/local$ sudo chmod -R 0755 ZendFramework/*

Now are we ready to enable the Zend Framework tool and enable the Zend Framework in PHP. First enable the tool, which is done by creating a symlink:

mz@marcz:/usr/local$ sudo ln -s /usr/local/ZendFramework/bin/zf.sh /usr/bin/zf

Test the tool by typing the following command:

mz@marcz:/usr/local$ zf show version

Which should give a output like this:’

Zend Framework Version: 1.11.11

The final step is to enable Zend Framework in the php.ini file. Open php.ini in your preferred editor, I use vi

mz@marcz:/usr/local$ sudo vi /etc/php5/apache2/php.ini

Search for “include_path”, which default looks like this:

;UNIX: ";/path1:/path2"; 
;include_path = ".:/usr/share/php";

Add the path for the Zend Framework library (remember to remove the ; at the beginning):

;UNIX: ";/path1:/path2"; 
include_path = ".:/usr/share/php:/usr/local/ZendFramework/library";

Save the file and exit. Restart apache, and you are good to go!

mz@marcz:/usr/local$ sudo service apache2 restart

Now you can start programming with Zend Framework! – Happy coding!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.