Basic Overview of PHP | How PHP works

Definition of PHP

PHP stands for “Hypertext Preprocessor”. It is an open-source scripting language and a powerful tool. It is widely used for creating dynamic websites, interactive page content.

Before getting started the introduction to PHP, it is quite necessary to know the basic understanding of HTML, CSS, JAVASCRIPT. If you have the idea of these three things then you can continue with PHP easily. We will discuss HTML,CSS,JAVASCRIPT later on.

How it is used| Uses of PHP

  • PHP is mostly used language for websites all over the world nowadays. Most of the websites are made with WordPress and WordPress has a large number of plugins and these plugins are made in PHP.
  • World’s biggest social media network Facebook which is run by PHP.
  • PHP is used to create application software like stock management, inventory management, billing software, and custom application, etc.

How PHP works

PHP works with its file system and those files can contain text, HTML, CSS, javascript, PHP Code, and have the “.php” extension. PHP codes are executed on the server and the output is displayed to the browser as plain HTML. We can execute PHP scripts online which is a web server and offline which is a local server. We will discuss how to run PHP programs on the local server.

Benefits/ Advantages of PHP

  • PHP is used to control user access authorization.
  • With PHP we can display images, PDF files, and even Flash movies.
  • We can run PHP on various platforms like Windows, Linux, Unix, etc.
  • PHP is compatible with servers like Apache, IIS, etc.
  • PHP is supported by a wide range of databases.

Requirements for running PHP programs/scripts/codes

  • First of all, install any local server like WAMP or XAMP, etc.
  • Install any editor like notepad++ or code-lobster or sublime text etc. but in my case, I use code-lobster mostly due to its reliable features and I recommend you to use code-lobster if you want.

How to run PHP programs/scripts in local server

After completing the installation process, click on the WAMP server and wait until it turns into a green icon. To run the PHP scripts we have to start the WAMP server that provides MySQL database access, we don’t need any extra database to be installed.

Type in the address bar of your browser “localhost” then you can see a list of Index which contains the folder names of your PHP scripts or projects. Again type “localhost/phpmyadmin” in the address bar then a screen will appear with username and password.

Type the username with “root” and leave the password field blank and press ENTER. Now you are in PhpMyadmin where you can create a database and the corresponding tables for the PHP projects.

Create a folder for your project in the place you have installed WAMP server. I suggest you install the WAMP server in D or E drive. Go to the ‘www’ folder inside the WAMP folder and then keep all your PHP projects or folder of the projects here.

To run the scripts or projects you did just go to the address bar and type “localhost/name of the PHP script file with .php extension as “localhost/helo.php” then you can see the output of the script which is executed by the server and returned back in the browser as plain HTML.

Also read, Introduction to PHP variables, data types, and strings

--

--

--

Hi, This is Biplab and I am web developer well versed in PHP and other open source technologies. I am here to share my experience with the community.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

7 Habits of Highly Effective Programmers

Predictability in Product Development with Story Estimation

Pluggable Nginx configuration with S3 and Terraform

Today, we terraform code. Tomorrow, Mars.

Enable Root access for the Linux EC2 Instances

The new Solidity ABI Encoder/Decoder and Optimizer

Path to Penetration Testing and Bug Bounty Hunting — Phase 1: Web PentesterLab Bootcamp : Part 1 —…

How Businesses Can Benefit from OpenAPI Specification

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Bipsmedium

Bipsmedium

Hi, This is Biplab and I am web developer well versed in PHP and other open source technologies. I am here to share my experience with the community.

More from Medium

PHP Curl Get Request with Parameters Example

PHP for Beginners: Loops

How To Use PHP (Part 3)

Calculate and pass on Stripe fees in your PHP application