Php

February 22, 2012 in Php

PHP

What is PHP?

PHP is one of the most popular HTML-embedded scripting language. You can use PHP to create dynamically generated pages quickly. PHP is a powerful scripting language that is used in most dynamically sites in our days.

How to install PHP on Ubuntu 11.04

To install php and php support for Apache just write the following in console

If you dont have apache already installed please follow this link http://www.allaboutlinux.eu/how-to-run-php-on-ubuntu/

$>sudo apt-get install php5 libapache2-mod-php5

When this done you are ready.

If you want to test that php installed successfully in to your system you can write and run a simple php script that will return to you the PHP information. So open the terminal and type:

$>sudo gedit /var/www/html/phpinfo.php

An empty document will open in gedit now just type the following and save the document.

<?php

print_r (phpinfo());

?>

Now just open your web browser and point it to http://localhost/phpinfo.php

If all went well a page with PHP info will come up.