Check wordpress version php

How to Check Your WordPress PHP Version

Kingsley Ubah

Kingsley Ubah Last updated Jan 28, 2022

PHP is the programming language that drives a WordPress site. Being the most fundamental part of a WordPress site, PHP greatly affects the website’s security, speed, performance, and SEO ranking.

In this article, I’ll explain to you what PHP is and tell you why it is important to regularly check for updates. Then I’ll give you a step-by-step guide to the various ways to check for your current WordPress PHP version.

What Is PHP?

PHP, which stands for PHP: Hypertext Preprocessor, is a popular programming language used to build websites. It’s specifically used to write page-related programs that run on the web server.

Every WordPress site is primarily built on four kinds of code; these are HTML, CSS, JavaScript, and PHP.

HTML and CSS are responsible for the look and presentation of content within the website. This includes text formatting, page layout, font selection, colours, positioning, and so on.

JavaScript and PHP are responsible for what the website does. Common tasks performed with both JavaScript and PHP include user validation, submitting a form to the server, UI and page modifications, and so on. However, unlike PHP, JavaScript primarily runs in the web browser.

So whenever you request a WordPress site or page, there are definitely some PHP programs running in the background to generate your requested HTML. PHP files end with a .php extension.

For example, here’s an image showing some PHP programs responsible for performing specific tasks in a WordPress site:

PHP files

Most WordPress themes and plugins are primarily built with PHP. For this reason, using the right PHP version for your WordPress site is of great importance.

The Importance of Having an Up-to-Date Version of PHP

PHP has undergone so many changes and updates over the years, and this will continue in the future. Each PHP version comes with new improvements. Simply put, newer is better when it comes to PHP.

Читайте также:  Java string array as param

As a result of the frequent updates, using an old version of PHP on your WordPress site will leave your site vulnerable to software incompatibility, security threats, and even speed and performance-related issues.

In fact, PHP 8 is proven to be twice as fast as any previous version of PHP. Some new syntax was also introduced to allow for cleaner PHP code.

To avoid becoming a victim of potentially devastating security breaches and code breaks, it is highly advised to check and update to a recommended version of PHP for your WordPress sites.

How to Find the Latest Available Version of PHP

The first step in the process of updating your PHP version is finding out the latest available and supported versions of PHP. For such information, go to php.net.

php.net provides a wealth of information regarding the release dates of supported PHP versions and how long they’ll be supported.

Supported PHP Versions

To know the specific PHP requirements for WordPress, visit the WordPress requirements page. There you’ll get detailed information about everything that’s required to successfully run WordPress on your computer, including information on what version of PHP to install.

PHP requirements for WordPress

At the time of writing, a PHP version of 7.4 or higher is required to run WordPress, but that requirement will surely change in the future.

How to Check for Your Current WordPress PHP Version

There are various ways to check for the current PHP version on which your WordPress installation is running.

The quickest way to check your WordPress PHP version is to use the Site Health area, which you’ll find under the Tools section in your WordPress admin panel.

After logging into your WordPress admin, go to Tools > Site Health > Info > Server. There you’ll find the PHP version on which your WordPress site is currently running.

Your PHP version

Another way to check your PHP version is with the use of a dedicated plug-in. The Display PHP version plug-in can be used to display the currently installed PHP version in the At a Glance admin dashboard widget.

To use the plug-in instead, simply go to Plugins > Add New. Under the search bar, search for Display PHP version. Click on Install, and then after installation, click on Activate.

Display PHP version

Once activated, it will display your PHP version on the At a Glance section inside your WordPress dashboard.

At a Glance section in admin dashboard

If you are using a hosting manager such as Bluehost or SiteGround, you can also check your cPanel, hosting management, or site tools area to find the PHP version.

Читайте также:  Expression evaluation in java

Wrapping Up

In this article, we defined what PHP is, stated its importance to WordPress, and talked about the benefits of installing an up-to-date PHP version to run your WordPress site.

We also walked through two processes for checking for the PHP version in WordPress, using the Site Health section and the Display PHP Version plug-in respectively.

Источник

2 Ways to Check Your WordPress PHP Version

Adam Burucs

Adam Burucs Last updated May 11, 2021

It is important to know which PHP version is working behind the scenes of your WordPress website–it affects available features, performance, and updates. In this quick tutorial I will show you two ways to find out the WordPress PHP version.

Before that, let’s quickly talk about why it is important, what PHP actually is, and how it relates to WordPress.

What is PHP?

“PHP is a popular general-purpose scripting language that is especially suited to web development. Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.” — php.net

PHP is a programming language that first appeared back in in 1995. Rasmus Lerdorf created it for making dynamic websites.

PHP is short for “PHP Hypertext Preprocessor” (though it was once known affectionately as “Personal Home Page” tools) and is what’s called a “server-side language”. This means the code is executed on the server and sends the result to the client-side or the browser.

Some examples of server-side functions:

  • creating data
  • reading data
  • updating data
  • deleting data
  • using databases
  • logging feature
  • login feature
  • parsing among data formats
  • generate dynamic websites
  • free to use
  • has extension «.php»
  • PHP files can contain HTML, CSS, JavaScript, and PHP code as well
  • multi-paradigm: functional, object-oriented, and procedural too
  • the typing system is also multi-faceted: dynamic, weak, gradual
  • implemented in C language
  • ability to create static and dynamic webpages

Example PHP Code

This is an example of some PHP code embedded into HTML (note the tag):

 http-equiv="X-UA-Compatible" content="IE=edge"> 
 name="viewport" content="width=device-width, initial-scale=1.0"> 

The result of this code is that a statement is echoed (or output):

Hello World!

Example PHP Code 2

We can use PHP to output other things too, such as information about the PHP server itself:

This will output lots of data. Here’s a small extract:

Extract
PHP Version 7.4.16
System Windows NT DESKTOP-93A9AT6 10.0 build 19041 (Windows 10) AMD64
Build Date Mar 2 2021 13:58:29

Advantages of PHP

PHP has all kinds of things going for it as a dynamic language/server technology:

  • multi-platform:
    • Windows,
    • Linux,
    • Unix,
    • Mac OS
    • MySQL
    • PostgreSQL
    • Sybase
    • IBM-DB2
    • Oracle Database
    • Mongo
    • SQLite and many others.

    PHP and WordPress

    PHP is the only backend language for WordPress. It is used for the engine, templates, and plugins.

    PHP Version Support in WordPress

    The latest version of WordPress at the time of writing (May 2021) is v5.7 which supports the following PHP versions:

    • 5.6 (this old version may expose the website to security issues)
    • 7.0
    • 7.1
    • 7.2
    • 7.3
    • 7.4
    • 8.0

    The recommended PHP version for WordPress is 7.x or 8.x. In 7.x there was a major performance improvement compared to 5.x. (And v6 was never released.)

    Actual PHP Versions

    Usually, the latest stable PHP version is recommended for use. The reasons being:

    • new features
    • development lifecycle (2 years of support per version)
    • security updates
    • performance improvements

    The latest PHP versions at the time (May 2021) of this article are:

    How to Check the WordPress PHP Version

    WordPress / Tools / Site Health

    If you have admin rights, you can go to the WordPress admin interface and choose: Tools > Site Health > Info / Server.

    Example Result

    You’ll see something like this, showing that the PHP version is (in this case) 7.4.16:

    Extract
    Server architecture Windows NT 10.0 AMD64
    Web server Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/7.4.16
    PHP version 7.4.16 (Supports 64bit values)
    PHP SAPI apache2handler
    PHP max input variables 1000

    PHP version in WordPress

    Display the WordPress PHP Version in the Footer

    It’s possible to display the PHP version at all times in the admin footer. This will save you having to navigate to the Tools page to search for the information yourself. It’s done with a free plugin called Version Info.

    In your WordPress admin go to Plugins > Add New and search for “Version Info”.

    version info plugin for wordpress

    Install and activate the plugin, and you’ll see information about the WordPress version, the PHP version, and MySQL version in the admin footer at all times:

    version info footer display

    Summary

    In this short tutorial, we learned what is PHP, the current available versions, and two ways to check the current version being used by your installation of WordPress. Remember: it is important to upgrade to the latest PHP version recommended by WordPress.

    Источник

Оцените статью