An introduction to Web Development using PHP

Web development is a vast field. There are many ways to go about a problem. One such part of web development is scripting languages. One should notice the difference between traditional programming languages like Java and these scripting languages.

This difference is that languages like Java need to be compiled first and an exe file is generated which is run to achieve the effect of the program.

On the contrary, a scripting language like PHP doesn’t need to be compiled. It runs right away. This results to faster processing and it’s relatively simple to use scripting languages over programming languages like Java.

Introduction:

One such very popular language is PHP. Which is strangely short for Hypertext Pre-processor? It was created by Rasmus and Lerdorf and was ready for commercial application by the year 1995. The main application for PHP was form processing and later it was diversified.

PHP alone can’t do anything. It is used on web pages with HTML and with a database to develop complex Web Applications. So to start with PHP, you need a working knowledge of at least a basic degree of HTML.

One highlight of the PHP language is that it is a server-side scripting language. Which means that it runs on the server where the website is hosted and not on the client side (browser). This means all the calculations and everything is done on the server and the results of these calculations are then sent to the browser to be displayed.

Two great things about PHP that appeal the most to beginners are that PHP is an open source language which is free to use and that it is compatible with most web servers like Apache and IIS.

Setting up a Development Environment on Localhost:

Well, most developers don’t have much money to start with.

So open source appears to be a great path to follow for them.

Let us see how can we setup PHP development environment for free.

Step 1:

Download XAMPP with PHP version 5.5.38: https://www.apachefriends.org/download.html

Version 5.5.38 is a great place to start for beginners.

Step 2:

Run the installer downloaded with all the default settings. Ideally, it should be installed right on your C drive.

Step 3:

Once it is installed, the Xampp control panel with open up. You will have to start the first option Apache which is the server.

To use a Database also start the second option MySQL.

Step 4:

Now check the file path where your XAMPP is installed. If it is installed as C:/xampp

Then the files in your server are located at C:/xampp/htdocs/

You will want to create a directory for every new project inside htdocs

So the file structure for your project will be like C:/xampp/htdocs/your-project-name

Where your-project-name is the name of your folder.

Step 5:

You can access the files in the folder by typing localhost/your-project-name

Happy coding.

So this was an introduction to PHP. Tell me if you have any doubts regarding the installation in the comments. If you want to use a database with PHP, let me know and will write a tutorial to help you through it.