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 -m
php -r "echo PHP_VERSION;"

The first line prints the PHP version, build information, and the Zend extensions built into the CLI, such as OPcache. It does not list every loaded extension: run php -m for the complete list. The last command 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.

How do I check the PHP version in cPanel?
Log in to cPanel, search for PHP, and open Select PHP Version or MultiPHP Manager. The current PHP version is shown for the account or domain. After changing it, verify the front-end version with a temporary PHP file or the hosting panel, because cached workers can keep serving the old version until they restart.
How do I check the PHP version in XAMPP?
Open the XAMPP Control Panel, click Shell, and run php -v. You can also open http://localhost/dashboard/phpinfo.php or create a file in C:\xampp\htdocs containing <?php echo PHP_VERSION; ?>, visit it in the browser, and delete it. On Windows, the binary is usually C:\xampp\php\php.exe.
Why does php -v show a different version from my website?
The command line and the web server can use different PHP binaries. A server may have a CLI version, a PHP-FPM pool version, and an Apache module version. Containers and multi-PHP hosts make this more common. To see what the website actually uses, check a temporary PHP file through the web server or use phpinfo; after an update, restart PHP-FPM or Apache.
How do I check the PHP version in WordPress?
In the WordPress admin, go to Tools > Site Health > Info > Server. The PHP version is listed there. You can also use the hosting panel. The WordPress version is under Tools > Site Health > Info > WordPress, or Dashboard > Updates.
Is phpinfo safe to use?
phpinfo exposes detailed server configuration, including paths and loaded modules. Use it only on a site you control, give the file an unguessable name, visit it over HTTPS, and delete it immediately. For a minimal check, use <?php echo PHP_VERSION; ?> instead of the full phpinfo page.
How do I check PHP version without server access?
Use the checker above. It reads public response headers and homepage markup. If the site hides its version, the result panel shows how to check it from the server, cPanel, Plesk, XAMPP, or WordPress Site Health. A remote check is best-effort and cannot see a version that is not exposed.
What is the latest PHP version?
The latest stable PHP branch is PHP 8.6, and the newest release in that branch is PHP 8.6.0. The PHP end-of-life page uses the same endoflife.date data and refreshes it automatically. The latest patch release matters as much as the branch: install the newest security release in the branch you run.

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