Knowing which PHP version your WordPress site runs is essential for security, performance, and plugin compatibility. This guide shows you several ways to find it—from simple dashboard tools to cPanel and server command line—so you can verify your setup and decide if an update is needed.
What You’ll Need
- Access to your WordPress admin dashboard (wp-admin).
- For some methods: FTP/SFTP access or a file manager in your hosting control panel.
- For the command-line method: SSH access to your server (optional).
Step-by-Step
Method 1: Using a Plugin (Easiest)
- Log in to your WordPress admin dashboard.
- Go to Plugins → Add New.
- Search for “php version display” or “server info”. Popular options include Display PHP Version or Server IP & Memory Usage Display.
- Install and activate the plugin of your choice.
- After activation, look for the PHP version in the admin bar at the top of the screen, or in the At a Glance section on the Dashboard (depending on the plugin).
- Once you’ve noted the version, you can deactivate and delete the plugin—it’s not needed permanently.
Method 2: Using a Temporary PHP File
- Open a text editor (like Notepad or TextEdit) and create a new file.
- Paste the following code into the file:
<?php phpinfo(); ?>
- Save the file as
phpinfo.php. - Upload this file to your WordPress root directory (the folder that contains
wp-config.php) using FTP or your hosting file manager. - In a browser, go to
https://yourdomain.com/phpinfo.php. - You’ll see a large table with PHP configuration details. The PHP Version appears at the top of the page.
- Important: Delete the
phpinfo.phpfile immediately after checking—it exposes sensitive server information.
Method 3: Via cPanel or Hosting Dashboard
- Log in to your hosting control panel (cPanel, Plesk, or your host’s custom dashboard).
- Look for a section called Software, Programming, or PHP Configuration.
- In cPanel, click Select PHP Version (often under the Software section).
- The current PHP version will be displayed at the top of the page. You can also change it here if your host allows.
- If you don’t see these options, check your host’s documentation or contact support—they can tell you the PHP version for your account.
Method 4: Using SSH (Command Line)
- Connect to your server via SSH (using a terminal or an app like PuTTY).
- Navigate to your WordPress root directory:
cd /path/to/wordpress
- Run the following command to see the PHP version for the CLI:
php -v
- To see the version that the web server uses, create a temporary file as in Method 2, or run:
php -i | grep "PHP Version"
- Note: The CLI version may differ from the web version if your host uses multiple PHP versions.
Common Mistakes
- Forgetting to delete phpinfo.php—this file is a security risk because it reveals server paths and settings.
- Confusing CLI and web PHP versions—the command line might show a different version than what Apache/Nginx uses. Always verify via a web-accessible method.
- Assuming the hosting dashboard shows the correct version—sometimes the dashboard shows the default version, but your domain might use a different one due to .htaccess or a custom config.
- Not checking after a PHP update—if your host upgrades PHP, your site might still use an older cached version until you restart services or clear opcache.
Tips
- Keep your PHP version up to date. WordPress recommends PHP 7.4 or higher; many hosts now default to PHP 8.x.
- Before updating PHP, test your site on a staging environment to ensure all plugins and themes are compatible.
- If you use a caching plugin, clear the cache after changing PHP versions.
- For quick checks without a plugin, you can install a security plugin like Wordfence; it shows PHP version in its dashboard.
- If you’re on a managed WordPress host (like WP Engine or Kinsta), they often display PHP version in their custom dashboard—no need for plugins.
Troubleshooting
The phpinfo() page shows a blank screen or error. This usually means PHP is not installed or the file wasn’t uploaded correctly. Check that the file name ends with .php and that you uploaded it to the correct directory. If you see a 500 error, try renaming the file to phpinfo.php.txt and back to .php to avoid file permission issues.
The plugin doesn’t show the version. Some plugins may be outdated or incompatible with your WordPress version. Try a different plugin, or use the phpinfo.php method instead.
Your hosting dashboard doesn’t show PHP version. Some budget hosts hide this. Contact support and ask them to confirm the PHP version for your account. You can also check your site’s HTTP headers using a tool like curl -I (command line) or online header checkers—the X-Powered-By header sometimes reveals the version, though it’s often disabled for security.
You see a different version after updating PHP. If your host changed the default, but your site still uses the old one, you may need to select the new version in your hosting dashboard or add a line to .htaccess (e.g., AddHandler application/x-httpd-php8 .php). Consult your host’s documentation.
Frequently Asked Questions
Why is my PHP version important?
PHP versions receive security fixes and performance improvements. Older versions are more vulnerable to attacks and may not support newer WordPress features or plugins.
Can I check PHP version without logging into WordPress?
Yes, you can use the phpinfo.php method, or check via FTP (look for a file like php.ini—though it may not exist). The most reliable is the temporary file method.
What PHP version should I use?
WordPress recommends PHP 7.4 or higher. Many hosts now default to PHP 8.0 or 8.1. Check your plugins’ compatibility before upgrading.
Will checking PHP version slow down my site?
No, checking is a one-time action. The plugin method adds a tiny overhead only while active; the phpinfo.php file is removed after use.
My host uses PHP 8.0, but my site shows 7.4. Why?
Your domain might be configured to use a different PHP version via a multi-PHP manager or .htaccess. Check your hosting dashboard for per-domain PHP settings.
Is it safe to update PHP myself?
If your host allows it, yes, but always backup your site and test in staging first. If unsure, ask your host to do it for you.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Secure Boot Battlefield 6 ASUS: Fix & Enable Guide
- Best Tech Websites to Follow for Pros & Beginners
- Second Wind Quest Walkthrough: Where Winds Meet6.00 min/km
- Enshrouded Weapon Upgrade Guide: How to Improve Gear5.00 min/km
- Connect Phone to Controller for Cloud Gaming
- Python Search Highlighting: Snippets & Matches