Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Explainers · Explainer

What Is PHP? A Plain Explanation

What Is PHP? A Plain Explanation

Short answer

PHP is an open-source scripting language that runs on the server and builds the web pages your visitors see. WordPress is written in PHP, and every page request runs PHP code that asks MySQL for content and fills a theme template with the answers. WordPress.org recommends PHP 8.3 or greater, and the WordPress hosting team recommends PHP 8.4 or later for production sites.

Key takeaways

  • PHP is an open-source scripting language that runs on the server and builds the pages visitors see.
  • WordPress is written in PHP, and every page request runs PHP code that pulls content from MySQL.
  • W3Techs measured PHP on 68.0% of websites with a known server-side language on 21 November 2026.
  • Each PHP branch gets 2 years of active support and 2 more years of security fixes only, then reaches end of life.
  • PHP 8.4 or later is recommended for production WordPress sites, and PHP 8.2 loses security fixes on 31 December 2026.

What is PHP?

PHP is an open-source scripting language that runs on the server and builds the web pages your visitors see.

PHP.net's manual defines PHP as a widely-used open-source general-purpose scripting language, especially suited for web development, that can be embedded into HTML.

PHP stands for “PHP: Hypertext Preprocessor,” a recursive acronym, which means the name contains itself.

PHP code sits inside HTML between <?php and ?> tags, and the server runs it before it sends the page to the browser.

The visitor receives the finished HTML, but never sees the PHP code that made it.

PHP runs much of the web. W3Techs measured PHP on 68.0% of websites whose server-side language it can identify, as of 21 November 2026.

PHP is still getting new releases. PHP 8.6 came out on 19 November 2026, and PHP.net's supported versions page lists active support for it until 31 December 2028 and security fixes until 31 December 2030.

How does PHP build a WordPress page?

When a visitor asks for a page, the web server hands the request to PHP, PHP runs WordPress, and WordPress sends back finished HTML.

WordPress itself is written in PHP, and the WordPress hosting handbook states that PHP is the language WordPress code is based on.

PHP asks MySQL for the post, the settings, and the menu, then fills a theme template with those answers.

The result is plain HTML, CSS, and JavaScript in the browser, with no trace of the PHP that built it.

PHP also runs on the command line without a server or browser, which suits scripts that run on a schedule, such as cron jobs.

Our guide on does PHP version affect WordPress speed explains why the version you run matters for load times.

What else can PHP do?

PHP can collect form data, generate dynamic page content, and send and receive cookies, and it can also output images, PDF files, JSON, and XML.

PHP.net's manual lists those jobs as the core of server-side scripting, along with encrypting data and sending emails.

PHP works with a wide range of databases, including MySQL through its own extension or through PDO, an abstraction layer, and any database that supports ODBC.

It runs on Linux, many Unix variants, Windows, and macOS, and it works with Apache, IIS, nginx, and other web servers.

PHP also has text tools built in, including Perl-compatible regular expressions and XML parsing through libxml2, SimpleXML, XMLReader, and XMLWriter.

Which PHP version should WordPress use?

Use PHP 8.4 or later for a production WordPress site, because that is what the WordPress hosting team recommends as of November 2026.

WordPress.org's requirements page recommends PHP 8.3 or greater for any host running WordPress.

The hosting handbook goes further: PHP 8.4 or later is recommended for production environments, PHP 8.4 is fully supported by WordPress 6.7 and later, and PHP 8.5 is fully supported by WordPress 6.9 and later.

WordPress 7.1 still runs on PHP 7.4 and later, but 7.4, 8.0, and 8.1 are end of life and kept only for backward compatibility.

W3Techs found version 8 on 68.3% of PHP sites, version 7 on 24.4%, and version 5 on 7.2%, as of 21 November 2026.

Our guide on which PHP version to use for WordPress gives the short answer for each common setup.

When does each PHP version stop getting fixes?

Each PHP branch gets 2 years of active support and 2 more years of security fixes only, then it reaches end of life and gets nothing.

PHP.net's supported versions page states that pattern, and its table lists the dates for every current branch.

PHP 8.2 gets security fixes until 31 December 2026, then it reaches end of life.

PHP 8.3 gets security fixes until 31 December 2027.

PHP 8.4 stays in active support until 31 December 2026, then gets security fixes until 31 December 2028.

PHP 8.5 stays in active support until 31 December 2027, then gets security fixes until 31 December 2029.

PHP 8.6, released on 19 November 2026, stays in active support until 31 December 2028 and gets security fixes until 31 December 2030.

PHP versionFirst releasedActive support untilSecurity fixes until
8.28 December 202231 December 202431 December 2026
8.323 November 202331 December 202531 December 2027
8.421 November 202431 December 202631 December 2028
8.520 November 202531 December 202731 December 2029
8.619 November 202631 December 202831 December 2030

Our guide on PHP version usage statistics shows how many sites still run each version.

How do you check your PHP version?

Check the PHP version in your hosting panel, then compare it with the WordPress.org recommendation.

Most hosts let you switch the PHP version in the hosting panel, and many show the current version on the same screen.

Your host's support team can also confirm the version if the panel does not show it.

Compare what you find with WordPress.org's recommendation of PHP 8.3 or greater.

If your version is older than 8.3, plan an upgrade. PHP 8.2 loses security fixes on 31 December 2026, so the clock is already running.

The old versions are still common. W3Techs found 24.4% of PHP sites still on version 7 and 7.2% on version 5, and those versions get no security fixes at all.

Our guide on how to check the PHP version on your host shows where to look on the main hosting panels.

What breaks when PHP is too old or too new?

An old PHP version stops getting security fixes, so flaws found after its end of life stay open on your site.

PHP 8.2 reaches end of life on 31 December 2026, and PHP 8.3 moved to security-only support on 31 December 2025, according to the WordPress hosting handbook.

A PHP version that is too new can break old plugins that use removed functions, so the handbook advises hosts to test their full stack before making a new PHP version the default.

WordPress.org warns that PHP 7.4 has reached its official end of life and may expose a site to security vulnerabilities.

WordPress has raised its PHP floor before. WordPress 7.0 raised the minimum required PHP version from 7.2.24 to 7.4, and support for PHP 7.2 and 7.3 was dropped in that release.

Always back up before you switch versions, and test the site right after the change. A staging copy is the safest place to try a new version first.

Our guide on how to update the PHP version in WordPress walks through a safe switch.

What are common myths about PHP?

Five myths about PHP keep coming back, and each one falls apart against the numbers.

Myth one: PHP is dead. W3Techs found PHP on 68.0% of websites with a known server-side language on 21 November 2026, and PHP 8.6 shipped 2 days earlier.

Myth two: PHP is slow. Speed depends on the version, the code, and the server, and PHP 8 runs most PHP sites today: W3Techs found version 8 on 68.3% of PHP sites.

Myth three: you need to write PHP to run WordPress. You do not. WordPress, themes, and plugins do the PHP work, and you only touch code if you want to.

Myth four: PHP and JavaScript do the same job. PHP runs on the server and builds the page, while JavaScript mostly runs in the browser after the page arrives.

Myth five: a newer PHP version always breaks things. WordPress 7.1 is fully compatible with PHP 7.4 through 8.5, so a careful upgrade on a supported version is a normal task, not a rebuild.

Frequently asked questions

Do I need to learn PHP to run WordPress?

No. WordPress, themes, and plugins do the PHP work for you, and you can run a site without writing a line of code. You only touch PHP if you want to build a custom theme or plugin, or fix a code error.

Does the PHP version affect my site?

Yes. The version matters for speed and security, because each branch gets 2 years of active support and 2 more years of security fixes only. PHP 8.2 loses security fixes on 31 December 2026, so a site on 8.2 should move to 8.4 or later.

What is the difference between PHP and JavaScript?

PHP runs on the server and builds the page before it reaches the browser, while JavaScript mostly runs in the browser after the page arrives. WordPress uses PHP to build pages and JavaScript for things that happen in the browser, such as the block editor.

Is PHP 8.6 safe to use with WordPress?

No. PHP 8.6 was released on 19 November 2026, and it gets active support until 31 December 2028 and security fixes until 31 December 2030. The WordPress hosting handbook lists compatibility up to PHP 8.5 for WordPress 7.1, so check before you switch to 8.6.

How do I find out which PHP version my site runs?

Check your hosting panel, which usually shows the current version and lets you switch it. Your host's support team can also confirm it. Compare what you find with the WordPress.org recommendation of PHP 8.3 or greater.

Sources

  1. PHP: Introduction PHP.net
  2. PHP: Supported Versions PHP.net
  3. Requirements WordPress.org
  4. Server Environment Make WordPress Hosting
  5. Usage Statistics and Market Share of PHP for Websites W3Techs

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.