• Beginning PHP

    by  • February 2, 2012 • Linux, PHP • 0 Comments

    PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.

    In this article, I would like to demonstrate how easy it is to get started with PHP. We will look at how to install Apache and PHP on a computer running Ubuntu and how to write our first PHP page.

     

    To install Apache and PHP from the Ubuntu repositories, open a terminal and run the commands below. Apache should start automatically once it is installed. Make sure that Apache is running by browsing to http://localhost in your computer. You should be seeing a “It Works !” page. We will also create a test.php file in the root directory of  our web server and assign rights to our user so that we can edit it.

    We are all set to begin with our first PHP page. Now open this file ( /var/www/test.php ) your favorite text editor and paste the following code.

    Save the file and test using your browser by accessing http://localhost/test.php .

    Test the result by right clicking the page in browser and selecting the view page source option. You can see that the HTML code embedded into the echo command was sent to the browser. Don’t forget to checkout http://www.php.net , the home of PHP.

    Hope you liked this article. Feel free to try, share and discuss.

    Related posts:

    1. Install VLC in Ubuntu 11.10

    About

    Could be found playing with his son Aryan when not working as a sysadmin. Likes to watch movies, play football, listen to music and chat with friends.

    http://www.undan.co.in

    Leave a Reply

    Your email address will not be published. Required fields are marked *