How to Update PHP Version for WordPress

WordPress

PHP Update is Recommended. Your site is running an insecure version of PHP (number), which should be updated.

Why is WordPress Dashboard showing this? Because your WordPress Installation is using a PHP version below latest supported version which currently is PHP 7.4. Whenever WordPress Content Management System updates its core functions, they are written in newer version of PHP as well, hence, warning message in WordPress Dashboard as the one above.

Newer version of PHP is more secure, and others with no access can’t easily break in to your WordPress built website when you use the more secure version of PHP programming language.

If you are also seeing this WordPress Dashboard warning message telling you PHP Update is Recommended Your site is running an insecure version of PHP. Here’s how you can change and upgrade PHP to higher versions such as 8.0, 8.2, 8.3.

First: contact your web hosting company to get them to change the PHP version for you, because most modern web hosting companies will actually do that free of charge just to keep you happy as their customer.

If they don’t, here’s what you can do:

How to Update PHP Version Step by Step

  • IMPORTANT: Backup your entire WordPress Site (including the phpMyAdmin Database)
  • Login to Your Web Hosting Account
  • Locate ‘Select PHP Version’
  • Write Down the PHP Version your website is currently using (because you can always revert back to that particular PHP version if something goes wrong after you make the switch)
  • Select / Change PHP Version (minimum 8.3 to remove WP error message) (PHP 8.3 is the latest stable PHP version)
  • Save Changes
  • Visit Your Website and double check if all is okay
  • If something goes wrong, follow the same steps and revert back to PHP Version your website was already using before you’ve switched it.
  • NOTE: check .htaccess file for any server directives related to PHP version control (if there, update the directives)

If you can’t upgrade it yourself, and your WordPress site is self installed, then you can conduct these tests:

If you already tried to update but you can’t find PHP version 8.3 option on your server, then, check if your server actually supports the PHP version 8.3 at minimum because some web hosting servers may not have updated their server software, thus, if your web server does not support minimum version 8.3, then you can not upgrade till your web hosting service provider installs the latest version of PHP

How to Check Installed PHP Version through phpinfo Function

Create a PHP file where you installed WordPress (usually is within cPanel > File Manager > public_html). You can name the file anything you want (i.e phptest.php) then, insert this code <?php phpinfo() ?> Finally request the test file https://www.example.com/phptest.php PHP version server API The information above would show which version of PHP is supported by your web server (once again, you could try the above technique if you tried to update php but you just can’t find php version 8.3 option to update your server).

Options for Changing PHP Version in cPanel

Most modern web hosting service providers such as GoDaddy Bluehost Siteground and others with Linux Self Hosted WordPress sites offer you cPanel web server management tool. Through which you can easily change PHP version, simply login to your cPanel and find

cPanel Software Select PHP Version link

Then simply choose your desired PHP Version

cPanel PHP Change

Note: Depending on your web hosting package you signed up for, you may not have Version 8.0 available, when this is the case, simply select the latest PHP version Number to avoid your site is running an insecure version of PHP message in WordPress

Options for Changing to Newer PHP Version 8.0 in Crazy Domains Web Hosting

Login to Your Crazy Domains Web Hosting Account (here’s help section) PHP Version Crazy Domains Web Hosting Setting

Then change to desired PHP Version (preferably the Version 8.3 but minimum 7.4 as recommended update by WordPress) and set that version as your server default.

Options for Changing to Newer PHP Version 8.2 in DreamHost Web Hosting

  1. Login to DreamHost Control Panel
  2. Local Domains > Manage Domains > Web Hosting (Edit)
  3. Locate Web Options and change to PHP 8.2 FastCGI

DreamHost Domain PHP version option

As with all software, PHP update requirements are natural because WordPress technology evolves, so does PHP.

What If Your website breaks after you change the php version

You would need to work out what plugin is NOT compatible with the selected php version, then update the plugin.

Double Check .htaccess File for Any PHP Handlers

AddHandler application/x-httpd-php-edge .php <IfModule mod_suphp.c> suPHP_ConfigPath /opt/phpedge/lib </IfModule>

AddType application/x-httpd-php82 .php If your .htaccess file has auto generated code related to PHP, double check after updating your current version. And update the PHP Version to your selected version (8.2)

Below is another sample to double check # php -- BEGIN cPanel-generated handler examples AddHandler application/x-httpd-ea-php73 .php .php7 .phtml #you would change the above to AddHandler application/x-httpd-ea-php82 .php .php8 .phtml #or, if you see something like this AddType application/x-httpd-php72 .php #you would change the above to AddType application/x-httpd-php82 .php

What do you do with these directives in .htaccess? Once you update the PHP version on the server, .htaccess file should also be updated for WordPress CMS, WordPress Themes/Plugins to function correctly.

By RankYa

RankYa is a digital services provider dedicated to growing your sales and business website's results. Highly experienced technical problem solver, Google products expert with proven 'Social Media Marketing' skills, RankYa (100% Australian Owned and Operated) is dedicated to helping small businesses to grow.

We're looking forward to contributing towards your online success. Contact Us.

1 comment

Questions? Leave a Comment!

Your email address will not be published. Required fields are marked *