Install apache,php in Terminal
Installing apache
Open Terminal. To open terminal click the Dash home from unity launcher. And type terminal in the search field.And click Terminal .(or) shortcut key Ctrl+Alt+T
Type this,
sudo apt-get install apache2
Type your password and enter,
Do you want to continue[y/n]? y
type 'y' and press enter..
After the successful installation , open your browser
http://localhost/
Installing PHP
sudo apt-get install php5 libapache2-mod-php5
Type your ubuntu password if needed.
Do you want to continue [y/n]? y
Type y and hit enter to confirm PHP installation.
After the successful installation restart Apache using the below code
sudo /etc/init.d/apache2 restart
Test PHP installation
To test PHP is installed, Type
sudo gedit /var/www/phpinfo.php
in the terminal and type your ubuntu password if needed. It will open the phpinfo.php file in gedit.Type below code in the phpinfo.php file, save and exit it .
<?php phpinfo() ?>
Now open your favorite browser and type http://localhost/phpinfo.php in the address bar and press enter. If you will see the below page , then your php works fine.
No comments:
Post a Comment