How to install and configure PHP on ubuntu 12.10 and ubuntu 12.04 and ubuntu server





Installing PHP

Open Terminal. and kind the below code in terminal and hit enter.

sudo apt-get install php5 libapache2-mod-php5
Type your ubuntu secret if required.

Type y and hit enter to substantiate PHP installation.
After the victorious installation restart Apache victimisation the below code

sudo /etc/init.d/apache2 restart
Test PHP installation

To test PHP is put in, Type

sudo gedit /var/www/phpinfo.php
<?php
phpinfo();
?>

in the terminal and kind your ubuntu secret if required. it'll open the phpinfo.php move into gedit.Type below code within the phpinfo.php file, save and exit it .


Now open your favorite browser and kind http://localhost/phpinfo.php within the address bar and press enter. If you may see the below page , then your php works fine.


2 comments:

  1. at the moment it says:
    in the terminal and kind your ubuntu secret if required. it'll open the phpinfo.php move into gedit.Type below code within the phpinfo.php file, save and exit it .

    there is no code below,

    please update

    ReplyDelete
  2. enter this inside phpinfo.php file

    ReplyDelete