PHP is the server-side programming language that most website software, including WordPress, is written in.

PHP is a programming language that runs on the web server rather than in the visitor's browser. When someone opens a page, the server runs the PHP code, which might read from a database, check whether the visitor is logged in and fill in a template. The result is plain HTML, and that's all the browser ever sees.

WordPress, Drupal, Joomla, Magento, Laravel and most other popular CMS platforms and frameworks are written in PHP. That's why almost every web hosting plan supports it.

How PHP works on a web server

  1. A visitor requests a page, such as /shop/.
  2. The web server, for example LiteSpeed or Apache, hands the request to PHP.
  3. PHP runs your application's code, often querying a MySQL database.
  4. PHP returns the finished HTML to the web server, which sends it to the visitor.

Each request is handled by a PHP worker. To avoid reading and compiling the same code every time, PHP's OPcache keeps compiled code in memory, which makes a big difference to speed.

Why your PHP version matters

PHP is released in versions, and each one is supported for a limited time. Newer versions are usually faster and include security fixes that older ones no longer get. Once a version reaches end of life, it stops receiving security patches, which leaves sites running on it more exposed to attack.

Choosing a version is a balance:

  • Too old and you miss performance gains and security fixes.
  • Too new and an old plugin or theme might not be compatible yet.

Most up-to-date WordPress sites run well on current PHP 8 releases. Check your plugins' and theme's requirements before switching.

How to change your PHP version

On most hosts you can pick a PHP version in the control panel, often per domain, through a tool like cPanel's PHP Selector or MultiPHP Manager. Before you switch:

  1. Take a backup, or test on a staging site.
  2. Update WordPress, plugins and themes.
  3. Switch the version and check key pages, forms and checkout.
  4. If something breaks, switch back and look at the error log to find the cause.

AblePage lets you choose any version from PHP 8.1 to 8.4.

Common PHP errors

  • White screen or "critical error": usually a fatal error in a plugin or theme. The error log shows which file.
  • Memory exhausted: the script needs more than the memory_limit setting allows.
  • Maximum execution time exceeded: a script ran longer than max_execution_time.
  • Deprecated warnings after an upgrade, which mean code needs updating before the next version.

PHP questions

Which PHP version should I use for WordPress?
Use the newest PHP 8 version that your plugins and theme support. Newer versions are faster and get security updates, but test first if your site uses older plugins.
Is PHP still used in 2026?
Yes. PHP powers WordPress and many other major platforms, so it still runs a large share of the world's websites.
Will changing my PHP version break my website?
It can if your site uses old code that isn't compatible. Take a backup, update everything first and switch back if anything breaks.
Was this definition helpful?
Share this definition