To run properly WordPress PHP Version minimum requirement 5.2.4. Likewise, all other web applications that run on the web have to meet certain minimum requirements to work efficiently. In this post, you will learn how to check the PHP version.

PHP is a powerful programming language for creating websites. If you want to know about the PHP version installed and to collect general information about the web server installation, then it can be achieved by running a simple PHP function “phpinfo();”. PHP stands for Hypertext Preprocessor, it is an open-source scripting language and has been a stable fixture on the server side of WordPress development ever since WordPress was introduced in 2003. Typically, most of the front-end and back-end of your WordPress website runs on PHP.

So, whenever a newer version of PHP is released it is important to upgrade to the latest PHP version. Running an up-to-date version of PHP ensures better performance and a powerful framework for creating a website.

In this post, we are going to discuss in detail how to check the PHP version on which your website is running. So without any further delay let’s begin with the discussion.

Method 1: Using PHPinfo() Function to Check the PHP Version

PHPinfo() is an absolutely helpful function present in PHP. This function is used to return the compiled information about PHP version, server information, PHP environment, OS version information, PHP extensions, PHP license, HTTP header, environment information, MySql version and paths.

To run this function, simply create a file and name it anything i.e. test.php and place it into the root directory of your website. In most linux servers root directory for a website in Public_HTML. Open the test.php file in a text editor and add the PHPInfo function in it.

<?php phpinfo(); ?>

Save the file. Now open “http://yourwebsite.com/test.php” and after running this file you should see an output somewhat like shown below.

Check php version

However, if you want to know about some specific value corresponds to specific settings then getting that information is quite simple. Let’s say you want to see the settings for memory_limit. Here you see two values where the first value is the set value for the present directory and the second value is the master value.  The local value plays a vital role as the local value can override the master value.

how to check php version

Method 2: Check the PHP Version Using the Command Line

You can use the command line to check the PHP version in case you have access to SSH into the remote server. You can also use this method to check the PHP version installed locally. Here are the steps you need to follow to check the PHP version using the command line:

  • First of all, type the PHP command as php -v. Notably, the php -v command works on Windows, Linux, macOS, and other supported systems. The output consists of the PHP version number, build date, and copyright information.

Method 3: Check with the Hosting Provider

You can check the PHP version of your WordPress website fro your Hosting Provider. All modern hosting panels i.e. cPanel, Plesk etc display the current PHP version.

Importance of WordPress PHP Version Checking

More and more modern dynamic websites are utilizing PHP these days. Do you know which version of PHP your website is currently running on? The basic knowledge about your web server environment will give a better understanding of it. In case of a CMS like WordPress any plugin you install and any theme you install runs a PHP script in the background and then work properly.

Since PHP is a crucial aspect of WordPress, running an up-to-date PHP version can have a major effect on the performance of the WordPress website. In short, PHP draws the right data from the database, enfolds it in the HTML and CSS, and then distributes it to the browser of the visitor. If any of this process is slow, it can terribly impact the overall experience of the visitors.

So checking the PHP version, and updating to the latest version of PHP ensures everything runs smoothly. The newer PHP versions are supported by developers across the world, who are constantly working to maintain, update, and fix any errors or bugs in the stable version release.

Why Check PHP Version and Update it for WordPress Website

PHP is the backbone of your WordPress website and it is required to check PHP version and keep it updated so that it keeps working well with all the plugins and Themes that you install. The outdated version may expose your site security vulnerabilities.

WordPress is an easy-to-use content management system (CMS). Since WordPress require minimum 5.2.4 version of PHP to run but there are a few plugins that might not work properly or not at all with this version. They require some specific version of PHP to work as intended. Therefore, the latest minimum version of PHP that WordPress fully support is 5.6. Whereas, you should also keep in mind that with PHP version 7 + the performance would increase drastically. So, it is required to upgrade WordPress to PHP version 7.

How to Check WordPress PHP Version

Nobody feels the need to check the PHP version unless there arises the need to do so. Here at TemplateToaster website builder blog, I have explained many simple ways to check PHP version of your site.

3 Ways to Check PHP Version

  • Check PHP Version with the help of phpinfo(); function.
  • You can install a WordPress plugin to Check PHP Version. For example Display PHP version is a popular WordPress plugin to check the PHP version.
  • You can also check the PHP version from the cpanel of your host provider.

The various plugins of WordPress with which you can check PHP version are WordPress, Display PHP Version, Version Info etc. with active installs of 60,000+, 10,000+, respectively. Such convenient plugins can help a non-technical person to determine the PHP version and some other server related information.

Okay, so these were the ways how you can check PHP version whichever suits you go ahead with that.

So, you are now ready to check PHP version

In this article, we have discussed in detail methods that can help you check the PHP version of your WordPress site. You can use the phpinfo() function, command line, or WordPress plugin to check the PHP version. You can also check in with your hosting provider to know the PHP version used on the website. By implementing the latest PHP version you can ensure high performance. Also if you are implementing new features, installing PHP-based apps, or trying to find any error on your site, it is important to know how to check PHP version the web server is  running.

I hope things are clear to you now and you can easily check PHP version and other environmental settings of your web server. As PHP is essential to your websites so always update to the recommended version. This will give you higher security and performance.

If you have checked PHP version and have updated it (if required) then, many Congratulations! Your site is future ready. You can read now best PHP frameworks and PHP Cheat sheet.

If you like this post or have any query regarding anything then I would love to hear from you. Please share your thoughts in the comments below.

Related Reading