Thursday, July 2, 2009

Zend Setup In Linux basically on Ubuntu 9.04

Zend Setup In Ubuntu 9.04

This blog helps you to setup Zend In Linux. It is written especially for Ubuntu 9.04.

First of all you need install php and mysql in you operating system. To install mysql follow this command

1)sudo apt-get install mysql

While installing mysql in your operating system you will be asked for new password for mysql “root”. So please insert root password. Then you will be asked for repeat password section for verification for password.

2)please type this command to start mysql

/etc/init.d/mysql start

Try this command also

/etc/init.d/mysql –help

3) similarly install Apache server in your operating system by following command

Sudo apt-get install apache2

4)Now install PHP in your operating system with the following command

Sudo apt-get install php5 php5-common php5-cli

5)after installing mysql,apache2,php you will need to be sure to run these commands

/etc/init.d/apache2 start

/etc/init.d/mysql start

Then browse http://localhost/

To Configure Zend :


After installing all of the above you will be able to configure Zend in your Operating System. But for this you need to follow some of the steps which are listed below

i)we need to make sure that rewrite_module is enabled in apache2 for the Zend Framework to work properly,so please check this rewrite_module by

a2dismod

a2enmod rewrite

ii)Similarly we need to enable AllowOverride All in the default site file so,

gedit /etc/apache2/sites-available/default

[…]

DocumentRoot /var/www/

Options FollowSymLinks

AllowOverride All

Options FollowSymLinks

AllowOverride All

Order allow,deny

allow from all

[….]

Install Zend Framework:

You can install Zend in two way .Firstly you can use subversion to install latest copy of ZendFramework. Secondly we may download latest copy from

here

/opt/Zend (suppose you have placed Zend inside opt)

NOTE:here Zend folder is used for representing ZendFramework1.8....folder

Please include Zend Library path in php.ini file by following these commands;

gedit /etc/php5/apache2/php.ini

Find this :

Include_path=”.:/usr/share/php5:/usr/share/pear"

and added zend library path after which above line looks like this:

include_path = ".:/opt/Zend/library:/usr/share/php5:/usr/share/pear"

Configure The Zend Tool

We need to setup path for command line so we’ll need to make following changes in PHP CLI

gedit /etc/php5/cli/php.ini

include_path = ".:/opt/Zend/library:/usr/share/php5:/usr/share/pear"

You will need to add these for final setup steps:

gedit ~/.bashrc

PATH=/opt/Zend/bin:"${PATH}"

Now after all these you are recommended to reboot your operating system for Zend

working properly.

After restarting your operating system try this command:

Zf.sh show version

And you will get this output

Zend FrameWork Version:1.8.3

Now you can use Zend Framework

For new project :

cd /var/www/

Zf.sh create project YourProjectName

Cheer you have successfully created a Zend Project which you can browse from

http://localhost/yourprojectname/public

Get Knowledge and Share Knowledge