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 -v
Fastest on a server you control.
Select PHP Version
Also called MultiPHP Manager on some hosts.
PHP Settings
Under Websites & Domains.
XAMPP Shell → php -v
Or open the XAMPP dashboard.
Tools → Site Health → Info → Server
The WordPress version is under Info → WordPress.
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.
Free · No sign-up · We never store the URLs you check
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.
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.
Check PHP version in cPanel
- Log in to cPanel for the hosting account.
- Search for PHP in the tools search.
- Open Select PHP Version (some hosts call it MultiPHP Manager).
- The current version is shown for the account or domain. On MultiPHP Manager, it may be listed per domain.
- 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.
Check PHP version in Plesk
- Log in to Plesk.
- Open Websites & Domains and select the site.
- Open PHP Settings.
- The PHP version is shown at the top of the page. The same page lets you switch versions and edit common PHP settings.
- 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.
Check PHP version in XAMPP
XAMPP ships its own PHP build. Open the XAMPP Control Panel, click Shell, and run:
php -vYou 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 -vFor 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.
Check PHP version in WordPress
- Log in to the WordPress admin.
- Open Tools → Site Health.
- Open Info → Server. The PHP version is listed there.
- 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.
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.