04.04
In my last post i have described how to install Apache in Ubuntu. You can found that article here. Now after installing Apache successfully we will install PHP now.
1. Open the terminal from Applications > Accessories > Terminal
2. Install PHP using apt-get by typing the following
sudo apt-get install php5 libapache2-mod-php5
This will install php5.x version to your machine. At time of writing this post it is recommended that you install PHP 5.2.X version as 5.3.X version is still not supported on lots of shared hosting server and if you make your application in PHP 5.3.X then you might have to convert it to PHP 5.2.X which is lengthy process.
Afer successfull installation restart Apache2 with following command.
sudo /etc/init.d/apache2 restart
So we have successfully installed PHP. To test it goto /var/www direcotry and make one test.php file with any text-editor you use. Open test.php and write following code.
<?php
print “Hello World !!!”;
?>
Now run it by typing http://localhost/test.php in firefox… You should see your “Hello World !!!”
Next Tutorial will be of Installing MySQL in Ubuntu / Linux.