Home Download Ubuntu

Install PHP on Ubuntu

You should have installed Apache before starting this.

sudo apt-get install php5 libapache2-mod-php5

Restart Apache:

sudo /etc/init.d/apache2 restart

Now let's test it. Create an index.php file in /var/www/

sudo nano /var/www/index.php

and write in it

<?php echo 'Hello World'; ?>

Now run it by typing http://localhost/index.php in firefox. You should see your "Hello World" sentence.

Resources: FarAway Blog


Post a Comment