PHP programming on Ubuntu 7.10

We can do PHP programming by any text editor, such as vi and nano. However, an Integrated Development Environment (IDE) is good for debugging.

For IDE, I choose EasyEclipse for LAMP and it is not required to install. Download it and double click it to run. However, we should install some server programs and do some configuration before using it.

Step 1
Make sure you have installed Java Runtime. Then, we should install Apache, MySQL and PHP5.

sudo apt-get install apache2 php5 php5-gd mysql-server libapache2-mod-php5 libapache2-mod-auth-mysql php5-mysql phpmyadmin mysql-admin

Then, set the MySQL root password as prompted and choose “Apache2” as prompted.

Step 2
Go to /etc/apache2/sites-available/default change “DocumentRoot” /var/www/ to somewhere in your home directory, such as :

DocumentRoot /home/samiux/workspace/
<Directory /home/samiux/workspace/>

Step 3
Download the EasyEclipse for LAMP. Double click the “eclipse” executable file to run. Then go to :

“Window” — “Preferences” — “PHPeclipse Web Development”

to change as the following :

This opens the options dialog. First click on PHP External Tools there’s two things to change Run PHP command and Parser command:

/usr/bin/php

“Parser command” default is /apache/php/php -l -f {0}
change to:

/usr/bin/php -l -f {0}

Step 4
Click on “Apache” under “PHP External Tools” where we’ll need to change the “Apache” and “Start Apache” values:Change “Start Apache” to:

-k start

and “Apache” to:

/usr/sbin/apache2

Step 5
Then, click on “MySQL” under “PHP External Tools” where we’ll need to change the “MySQL” values:

Change “MySQL” to:

/usr/bin/mysql

Final step
Finally, restart the Apache :

sudo /etc/init.d/apache2 restart

Enjoy PHP programming on Ubuntu !!!

Advertisements