First of all, install PHP5 using the repository by typing the following command in the terminal.
sudo apt-get install php5
Go to an internet browser and type http://localhost. You should get an "It works" message if the installation is complete.
Otherwise you can edit the index.html file located at /var/www folder and rename the filename to index.php and replace the code with the following code.
<?php phpinfo(); ?>
Install MySQL using the following command
sudo apt-get install mysql-server
Also, install PHP module for MySQL by using the following command.
sudo apt-get install php5-mysql
You might want to install Phpmyadmin to help you access and run SQL commands on your databases. Run the following command if you want to install it. Otherwise, you can use MySQL from the terminal itself.
sudo apt-get install phpmyadmin
Now, download the Zend Framework Zip or Tar file from http://framework.zend.com/download/latest and extract the archive. In my case in the following way.
sudo unzip /home/aabhushan/Downloads/ZendFramework-1.11.2.zip
Now, move the extracted Zend Framework folder to the PHP folder.
sudo mv /home/aabhushan/ZendFramework-1.11.2/ /usr/share/php5/
Now,create a soft link for the Zend Framework folder so that you will not have to restart apache when you replace the old version of Zend with the new one.
cd /usr/share/php5/
sudo ln -s ZendFramework-1.11.2/ zend
Now, if you want to include the path to Zend by yourself in your application then you can do it by adding set_include_path in the following way,
set_include_path(get_include_path().PATH_SEPARATOR.'/usr/share/php5/zend');
Otherwise, if you want to add it by default then you can set it in the php settings by editing /etc/php5/apache2/php.ini. In my case in the following way,
sudo gedit /etc/php5/apache2/php.ini
Now, edit the line,
; include_path = ".;/usr/share/php5:/usr/share/pear"
to,
include_path = ".;/usr/share/php5:/usr/share/pear:/usr/share/php5/zend/library"
Now, you need to restart apache and Zend Framework is successfully installed to your computer.
sudo /etc/init.d/apache2 restart
In order to enable apache2 mode rewrite or mod_rewrite, to be able to call the controller action by using "/public/controller/action" instead of using "/public/index.php/controller/action" execute the following command in the terminal.
sudo a2enmod rewrite
Good luck!