Skip to content
PHP Version Checker
Tutorial

How to Check Your PHP Version

The fastest method depends on where PHP runs. Use the command line on a server, the hosting panel in cPanel or Plesk, the XAMPP Shell for a local install, or Site Health in WordPress. If you only have a URL, the checker below reads the public version a site exposes.

php -vcPanelPleskXAMPPWordPress
SSH or terminal

php -v

Fastest on a server you control.

cPanel

Select PHP Version

Also called MultiPHP Manager on some hosts.

Plesk

PHP Settings

Under Websites & Domains.

XAMPP

XAMPP Shell → php -v

Or open the XAMPP dashboard.

WordPress admin

Tools → Site Health → Info → Server

The WordPress version is under Info → WordPress.

Only a URL

Use the checker below

Reads public headers; no server access needed.

Remote check

Check a live website

No server access? Paste a public URL. The checker reads response headers and homepage markup, then compares the PHP branch with its support and PHP2Shell status. It never scans or probes the server.

Try an example:

Free · No sign-up · We never store the URLs you check

Method 1

Check PHP version from the command line

On a server or local development machine with shell access, run one of these commands:

php -v
php -r "echo PHP_VERSION;"

The first line prints the PHP version, build date, and configured extensions. The second prints only the version string, which is handy in scripts. On Windows with XAMPP, the binary is usually at C:\xampp\php\php.exe, so the command is C:\xampp\php\php.exe -v.

CLI and web can differ

The command line may use a different PHP binary from PHP-FPM or Apache. If you are diagnosing a website, verify the version through the web server as well.

Method 2

Check PHP version with phpinfo or a temporary file

If you have file access to the website, create a temporary PHP file in the web root. The minimal version prints only the version:

<?php echo PHP_VERSION; ?>

For full configuration details, use <?php phpinfo(); ?>. Upload the file, visit it over HTTPS, note the version, and delete it immediately. phpinfo exposes paths, loaded modules, and environment details.

Only on a site you control

Do not leave phpinfo or a version file on a public server. Use an unguessable filename, visit it once, and remove it.

Method 3

Check PHP version in cPanel

  1. Log in to cPanel for the hosting account.
  2. Search for PHP in the tools search.
  3. Open Select PHP Version (some hosts call it MultiPHP Manager).
  4. The current version is shown for the account or domain. On MultiPHP Manager, it may be listed per domain.
  5. If you change it, verify the front-end version with a temporary PHP file. Restart PHP-FPM or Apache if the host provides that control.

The panel controls the PHP version used by the web server. The account's command-line PHP may be different.

Method 4

Check PHP version in Plesk

  1. Log in to Plesk.
  2. Open Websites & Domains and select the site.
  3. Open PHP Settings.
  4. The PHP version is shown at the top of the page. The same page lets you switch versions and edit common PHP settings.
  5. After a change, verify the web version and restart PHP-FPM if the panel does not do it for you.

Plesk may show a different PHP version for each domain or subscription. Check the site you are actually debugging.

Method 5

Check PHP version in XAMPP

XAMPP ships its own PHP build. Open the XAMPP Control Panel, click Shell, and run:

php -v

You can also open http://localhost/dashboard/phpinfo.php from the XAMPP dashboard. To check the bundled PHP binary directly on Windows, run:

C:\xampp\php\php.exe -v

For a website running under XAMPP, create C:\xampp\htdocs\version.php with <?php echo PHP_VERSION; ?>, visit http://localhost/version.php, and delete the file.

Method 6

Check PHP version in WordPress

  1. Log in to the WordPress admin.
  2. Open Tools → Site Health.
  3. Open Info → Server. The PHP version is listed there.
  4. Open Info → WordPress to see the WordPress version.

Site Health shows what the web server actually runs, which is more useful than the CLI version. If the host offers a PHP selector, use it to change versions after testing on staging. How WordPress versions map to PHP requirements is covered on the WordPress PHP version page.

Troubleshooting

Why the CLI and website versions can differ

A server can have several PHP builds: one for the command line, one for PHP-FPM, and one for an Apache module. Multi-PHP hosting, Docker images, and control panels make this common. The CLI binary may be newer or older than the binary serving your website.

Always verify the web SAPI when you are checking a site. A temporary PHP file, phpinfo, Site Health, or the hosting panel shows the version the web server uses. After an update, restart PHP-FPM, Apache, and any containers so old workers stop serving the old binary.

FAQ

PHP version questions

Common questions about cPanel, XAMPP, WordPress, and remote checks.

Official references

Temporary files should be deleted immediately. Only check servers you own or are authorized to inspect.

Check a live site instead

No server access? The remote checker takes a few seconds.

Back to the PHP version checker