Back to Web Design Glossary

What is PHP?

PHP (a recursive acronym for PHP: Hypertext Preprocessor) is an open-source, server-side scripting language used to build dynamic websites and web applications. PHP code runs on the web server, not in the visitor’s browser, and can be embedded directly in HTML. Popular content management systems, including WordPress, are written in PHP.

More About PHP

PHP is a server-side language that can be embedded in HTML. Developers use it to generate dynamic content, track sessions, and work with databases such as MySQL. You can also use PHP to build entire applications.

Some of the most popular websites and software options globally are based on PHP. Facebook was initially created using PHP, and the language is the cornerstone of the popular WordPress CMS. As of 9 August 2026, W3Techs measures PHP in use on 70.5% of all websites whose server-side programming language it can identify.

How PHP works

PHP does its work before anything reaches the browser:

Flow diagram showing a visitor's browser requesting a .php page from the web server, the server's PHP interpreter executing the code, and only the resulting HTML being sent back to the browser — illustrating that PHP runs server-side and its source code never reaches the visitor.
  1. A visitor requests a page that contains PHP (usually a .php file).
  2. The web server runs the PHP code in that file.
  3. The server sends only the resulting HTML to the browser.

Visitors never see your PHP source code, only its output. That’s also why PHP errors and version problems surface on the server, not in the visitor’s browser.

Here’s a small worked example. This line in a site footer prints the current year automatically:

<footer>© <?php echo date('Y'); ?> Example Co.</footer>

The browser receives only the rendered HTML: <footer>© 2026 Example Co.</footer>. The PHP itself never leaves the server.

PHP vs. JavaScript

PHP and JavaScript sit on opposite sides of the same page load:

  • PHP runs on the web server, before the page is sent. It builds the HTML.
  • JavaScript runs mostly in the browser, after the page loads, and handles interactivity. It can also run on servers via Node.js.

For WordPress users, the split is simple: themes and plugins are written mainly in PHP, anything that reacts inside the browser is JavaScript, and most real sites use both.

Supported PHP versions

Each PHP release branch gets 2 years of active support plus 2 more years of security fixes only, then reaches end of life. As of August 2026, PHP 8.4 and 8.5 are in active support (8.5 shipped on 20 November 2025), while PHP 8.2 and 8.3 receive security fixes only until 31 December 2026 and 31 December 2027, respectively. The php.net supported versions table always has the current dates.

The risk of ignoring this schedule is real: an end-of-life PHP version receives no security patches, so any vulnerability found in it stays open on your site. WordPress currently recommends PHP 8.3 or greater.

How to check and update your PHP version

In WordPress, go to Tools → Site Health to see the PHP version your site runs. Most hosting control panels let you switch the PHP version per site. Test the switch on a staging copy first, because older plugins and themes can break on a newer branch. Our guide to updating your PHP version walks through the whole process.

Learn PHP if you plan to develop or troubleshoot WordPress themes and plugins. Otherwise, you can manage a WordPress site without writing PHP. If you want to pick it up, start with our guide on how to learn PHP.

Frequently Asked Questions

No. You can build and run a WordPress site without writing any PHP. Knowing the basics helps when you customize a theme (for example, editing functions.php) or need to read an error message when something breaks.
PHP is a recursive acronym for “PHP: Hypertext Preprocessor.” The name traces back to 1994, when creator Rasmus Lerdorf called his original scripts “Personal Home Page Tools,” a toolkit he used to track visits to his online resume.
Yes. The PHP manual names three main fields of use: server-side scripting, command-line scripting, and desktop applications. Command-line PHP needs only the PHP parser, no browser or web server, and is commonly used for cron jobs and text-processing scripts.
Special Offer

Custom Website Design

Get a one-of-a-kind, mobile-friendly website that makes your brand truly shine. Share your vision with us and we'll take it from there.

Custom Web Design