EOL Hub

How to check your PHP version

Short answer: on WordPress, open Tools > Site Health > Info > Server. On a server, run php -v. On shared hosting, look in your control panel. Then compare the number with the patched releases: 8.5.12, 8.4.27, 8.3.36 or 8.2.35 or newer.[1][5]

How do I check the PHP version in WordPress?

From the WordPress dashboard, go to Tools > Site Health, select the Info tab, expand Server and find PHP version.[1]

How do I check it in my hosting control panel?

Most hosts show the PHP version in their dashboard, often under a "PHP version" or "PHP selector" setting. If you can't find it, ask your host's support team.

How do I check the PHP version from the command line?

If you have shell access, run:

php -v

The -v option prints the version.[2] Note that the command-line PHP can differ from the PHP that serves your website (for example PHP-FPM), so confirm with one of the web-based methods too.

How do I check with phpinfo()?

Create a file with a random name such as info-7f3k.php containing <?php phpinfo();, open it in your browser, read the version at the top, then delete the file right away. phpinfo() shows a lot of configuration detail you don't want to leave public.[3] In your own code, phpversion() or the PHP_VERSION constant returns the version.[4]

Can I check my PHP version online?

Some servers announce their PHP version in an X-Powered-By response header; this is controlled by the expose_php setting, and many hosts turn it off.[6] The free PHP Patch Check reads that public header for a domain you prove you own, and tells you plainly whether the announced version includes the Oct 2026 fixes. It never sends attack traffic.

Is my version patched?

The Oct 21, 2026 fixes are in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35.[5] If you're on one of those or newer in the same branch, you have the fixes. If your Linux distribution or host backports fixes, the version number may look older even when patched, so ask your vendor. If you're on PHP 8.1 or older, you're on an end-of-life branch: see PHP end of life.

Frequently asked questions

What is the command to check the PHP version?

Run php -v on the server. Remember the command-line PHP can differ from the version serving your website.

Where is the PHP version in WordPress?

Tools, Site Health, Info tab, Server section, PHP version.

Why does my site hide its PHP version?

The expose_php setting controls whether PHP announces its version in the X-Powered-By header. Many hosts turn it off, which is fine; use another method to check.

Is it safe to leave a phpinfo() page online?

No. It shows detailed configuration. Use a random file name and delete it as soon as you've read the version.

Sources for this page

  1. WordPress.org: Update PHP
  2. PHP Manual: Command line options
  3. PHP Manual: phpinfo()
  4. PHP Manual: phpversion()
  5. PHP.net: Security advisory, critical remote code execution vulnerabilities, update now (Oct 21, 2026)
  6. PHP Manual: expose_php setting