What is PHP?
PHP is an open source, general-purpose scripting language that is especially suited to web development and can be embedded directly in HTML. Its full form is PHP: Hypertext Preprocessor. PHP code runs on the web server, and the visitor's browser receives only the HTML that the code produces.
That last point is what separates PHP from JavaScript running in a browser. The visitor never sees your PHP source, only its output. This makes PHP a natural fit for anything that needs a database, a login or a form: the logic and the passwords stay on the server.
PHP full form: why the name contains itself
PHP stands for PHP: Hypertext Preprocessor. The first word of the full form is the abbreviation itself, which the PHP manual calls a recursive acronym. The letters originally came from "Personal Home Page", the name of the first set of tools released in the mid-1990s. The language outgrew that name long ago, but the three letters stayed.
"Hypertext" is the HT in HTML. "Preprocessor" describes the job: PHP processes a page on the server before it is sent to the browser.
How PHP runs on the server
The PHP manual lists three things needed for server-side scripting: the PHP parser, a web server and a web browser. A single page view goes through these steps:
- Request. The browser asks for a URL such as
https://example.com/contact.php. - Hand-off. The web server (Apache, Nginx or LiteSpeed) sees that the file is PHP and passes it to the PHP interpreter.
- Execution. PHP runs the code between the
<?phpand?>tags. It may read form data, query a database such as MySQL, or read a file. - HTML out. Whatever the script prints becomes the response. Anything outside the PHP tags is sent as it is.
- Response. The browser receives plain HTML and renders it. It cannot tell which lines came from PHP.
PHP can also run from the command line with no web server at all, which is how scheduled scripts work. Our guide to cron jobs shows how to run one on a timer.
A simple PHP program
You need nothing more than a text editor and a place where PHP is installed: any PHP web hosting account, or PHP on your own computer.
1. Hello world
Save this as hello.php:
<?php
echo "Hello, world!";
Upload it to your site's public_html folder and open https://example.com/hello.php, or run it in a terminal with php hello.php. Every PHP statement ends with a semicolon, and echo prints text. A file that contains only PHP does not need the closing ?> tag.
2. A variable and a loop
Variables start with a dollar sign. This script stores a list in an array and prints each item inside an HTML list:
<?php
$cities = ["Mumbai", "Delhi", "Pune"];
?>
<ul>
<?php foreach ($cities as $city) { ?>
<li>Hello from <?php echo $city; ?></li>
<?php } ?>
</ul>
Notice how the file jumps in and out of PHP mode. The HTML is written normally, and PHP fills in the parts that change.
3. A small form handler
Forms are where PHP earns its place. First, a plain HTML form saved as form.html:
<form action="welcome.php" method="post">
<label for="name">Your name:</label>
<input name="name" id="name" type="text">
<button type="submit">Send</button>
</form>
Then the script that receives it, saved as welcome.php:
<?php
$name = trim($_POST['name'] ?? '');
if ($name === '') {
echo "Please enter your name.";
} else {
echo "Namaste, " . htmlspecialchars($name) . "!";
}
PHP fills the $_POST array with the submitted fields automatically. The call to htmlspecialchars() matters: it encodes characters that are special in HTML, so a visitor cannot inject HTML tags or JavaScript into your page by typing them into the form. Treat it as a rule: never print user input without escaping it.
What is PHP used for?
- Content management systems. WordPress, Drupal and Joomla are all written in PHP. If you run a WordPress site, you already run PHP.
- Online shops. WooCommerce (a WordPress plugin), Magento and OpenCart.
- Custom web applications. Frameworks such as Laravel, Symfony and CodeIgniter give structure to larger projects: routing, database models, queues and testing.
- Everyday site features. Contact forms, logins and sessions, file uploads, sending and receiving cookies, and generating pages from a database.
- APIs and scripts. JSON back ends for mobile apps, and command-line scripts for imports, reports and scheduled tasks.
PHP vs JavaScript vs Python
All three can build a website. They differ mostly in where they run and how they are hosted.
| PHP | JavaScript | Python | |
|---|---|---|---|
| Where it runs | On the server | In the browser, and on the server with Node.js | On the server |
| Main focus | Web pages and web back ends | Interactive pages, plus back ends through Node.js | General purpose: web, data, automation, machine learning |
| How a page is served | The web server runs the script for each request | A Node.js process stays running and answers requests | An application server process stays running and answers requests |
| Typical hosting | Almost any shared hosting plan | A VPS or an app platform for Node.js | A VPS or an app platform |
| Well-known tools | WordPress, Laravel, Symfony | React, Express, Next.js | Django, Flask, FastAPI |
In practice they work together. A PHP site still uses JavaScript in the browser for menus and form checks. If Python is your choice, see our guide to Python hosting in India.
Supported PHP versions in November 2026
Each PHP branch gets two years of active support (bug and security fixes), followed by two more years of fixes for critical security issues only. After four years it reaches end of life. This is the table on php.net as checked on 21 November 2026:
| Branch | First released | Active support until | Security fixes until |
|---|---|---|---|
| PHP 8.2 | 8 Dec 2022 | Ended 31 Dec 2024 | 31 Dec 2026 |
| PHP 8.3 | 23 Nov 2023 | Ended 31 Dec 2025 | 31 Dec 2027 |
| PHP 8.4 | 21 Nov 2024 | 31 Dec 2026 | 31 Dec 2028 |
| PHP 8.5 | 20 Nov 2025 | 31 Dec 2027 | 31 Dec 2029 |
| PHP 8.6 | 19 Nov 2026 | 31 Dec 2028 | 31 Dec 2030 |
PHP 8.1, every 7.x release and PHP 5.6 are past end of life and receive no fixes from the PHP project. PHP 8.2 loses security support at the end of December 2026, so plan that upgrade now. A branch that is only days old, as 8.6 is today, may not yet be supported by your plugins, theme or framework, so check their requirements before switching a live site to it.
How to check your PHP version
On a server or computer with terminal access, run:
php -v
This prints the version of the command-line PHP, which is not always the version your website uses. To see what the website itself runs, create a file called version.php in the site folder:
<?php
echo PHP_VERSION;
For the full configuration, including loaded extensions and settings, use phpinfo():
<?php
phpinfo();
Open the file in a browser, read what you need, then delete the file. The phpinfo() page reveals paths, settings and environment details that strangers should not see.
How to change the PHP version in cPanel
cPanel's MultiPHP Manager sets the PHP version for each domain separately. According to cPanel's documentation the steps are:
- Log in to cPanel and open MultiPHP Manager in the Software section.
- Tick the checkbox next to the domain you want to change. The list shows the version each domain uses now.
- Choose a version from the PHP Version menu.
- Click Apply.
If the version you want is not in the menu, it is not installed on the server or not enabled for your account, and only the hosting provider can add it. If you need a version your current host does not offer, a Bigdomainhost KVM VPS gives you root access to install it yourself. Choosing inherit makes the domain follow the server's default version. Some hosts use a different PHP selector in place of MultiPHP Manager, but the idea is the same. New to the panel? Start with what cPanel is.
A short checklist before you switch a live site:
- Take a backup of the files and the database.
- Update WordPress, plugins and themes, or your framework and its packages, first.
- Check that each plugin or package supports the target version.
- Switch at a quiet hour, then click through the site, the admin area and the checkout.
- If something breaks, set the previous version in MultiPHP Manager and read the error log.
PHP-FPM in one paragraph
PHP-FPM (FastCGI Process Manager) is the FastCGI implementation that ships with PHP and is the usual way to run PHP behind Nginx and many Apache servers. Instead of starting PHP afresh for every request, it keeps pools of worker processes ready and hands requests to them. The PHP manual describes its main features as process management with graceful stop and start, pools that can run under different users and settings, and configurable logging. On cPanel, MultiPHP Manager shows whether PHP-FPM is enabled for each domain. Servers that run LiteSpeed use LiteSpeed's own PHP handler instead.
PHP on Bigdomainhost
On Bigdomainhost cPanel hosting, PHP 5.6 to 8.4 is selectable per domain, on LiteSpeed servers in Mumbai. The older versions are there for legacy applications that cannot be upgraded yet, and new sites should use a version that still receives security fixes. WordPress hosting comes with WordPress already installed. On a KVM VPS you have full root access, so you can install any PHP version you need. For help choosing a version, phone +91 75994 50220 in IST business hours, WhatsApp the same number at any time, or email support@bigdomainhost.com.
Sources (checked )
- PHP Manual: What is PHP and what can it do?
- PHP.net: Supported Versions
- PHP Manual: A simple tutorial: Dealing with Forms
- PHP Manual: phpinfo
- PHP Manual: FastCGI Process Manager (FPM)
- cPanel & WHM Documentation: MultiPHP Manager for cPanel
How Bigdomainhost can help
To run a PHP site without managing a server yourself, Bigdomainhost Web & cPanel hosting lets you choose PHP 5.6 to 8.4 per domain on LiteSpeed servers in Mumbai, with a free SSL certificate for every domain, 30 days of free backups and free migration from your current host. If your application needs a PHP version or extension that shared hosting cannot offer, a KVM VPS gives you full root access instead. Not sure which fits? Ask our engineers on WhatsApp at any time.