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

Newer version of PHP is more secure and thus hackers can’t easily break in to your website when you use the more secure version. Whenever WordPress updates its core functions, they are written in newer version of PHP as well, hence, warning message in WordPress Dashboard as the one above.

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 and want to change the PHP Version. Simply follow these steps:

Contact your web hosting company first to get them to change PHP version for you as most modern web hosting companies will actually do that free of charge just to keep you happy as their customer.

But if you want to tackle it yourself, and your WordPress site is self installed, then do this:

If you already tried to update but you can’t find PHP version 7.4 option on your server, then, check if your server actually supports the PHP version 7.4 at minimum because some web hosting servers may not have updated their server software, thus, if your web server does not support minimum version 7.4, 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 installed on web server 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 7.4 option to update your server).

How to Update Step by Step

  • 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 switch)
  • Select / Change PHP Version (minimum 7.4 to remove WP error message) (latest is 8.0)
  • 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.

Options for Changing PHP Version in cPanel

Most modern web hosting service providers such as GoDaddy and others with Linux Self Hosted WordPress sites offer you cPanel. 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.0 but minimum 7.4 as recommended update by WordPress) and set that version as your server default. PHP version selection option Crazy Domains Web Hosting Account

Options for Changing to Newer PHP Version 8.0 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.0 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-php72 .php

AddType application/x-httpd-php56 .php If your .htaccess file has auto generated code related to PHP, double check after updating your current version. # BEGIN cPanel-generated php ini directives, do not edit # Manual editing of this file may result in unexpected behavior. # To make changes to this file, use the cPanel MultiPHP INI Editor (Home << Software << MultiPHP INI Editor) # For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI) <IfModule php5_module> php_flag asp_tags Off php_flag display_errors Off php_value max_execution_time 30 php_value max_input_time 60 php_value max_input_vars 1000 php_value memory_limit 128M php_value post_max_size 18M php_value session.gc_maxlifetime 1440 php_value session.save_path "/var/cpanel/php/sessions/ea-php56" php_value upload_max_filesize 15M php_flag zlib.output_compression Off </IfModule> # END cPanel-generated php ini directives, do not edit Below is another sample to double check # php -- BEGIN cPanel-generated handler, do not edit # Set the “ea-php73” package as the default “PHP” programming language. <IfModule mime_module> AddHandler application/x-httpd-ea-php73 .php .php7 .phtml </IfModule> # php -- END cPanel-generated handler, do not edit Another example AddType application/x-httpd-php72 .php What do you do with these directives in .htaccess? Once you update the PHP version, .htaccess file should also auto update.

Advanced Users Only: if .htaccess didn’t update the php version according to your selected/updated version. Download .htaccess file for backup. Then, manually change the php version number and save .htaccess file. Check the website. If all good, good. If not, revert back the changes you made in .htaccess file and contact web hosting service provider.

Currently Works for Updating These Versions

Note: The outdated PHP version number can be differ depending on your WordPress installation. Below are the PHP versions which has to be updated.

  • (7.3.27)
  • (7.2.26)
  • (5.6.30)
  • PHP 4.4 (alt-php44)
  • PHP 5.1 (alt-php51)
  • PHP 5.2 (alt-php52)
  • PHP 5.3 (alt-php53)
  • PHP 5.4 (alt-php54)
  • PHP 5.5 (alt-php55)
  • PHP 5.6 (alt-php56)
  • PHP 7.0 (alt-php70)
  • PHP 7.1 (alt-php71)
  • PHP 7.2 (alt-php72)
  • PHP 7.3 (alt-php73)
  • PHP 5.5 (ea-php55)
  • PHP 5.6 (ea-php56)
  • PHP 7.0 (ea-php70)
  • PHP 7.2 (ea-php72)
  • PHP 7.3 (ea-php73)

Get your business website ready for 2022. Increase Google rankings and website conversions. Check out the latest

Master Class Course (Guaranteed Results)

By RankYa

RankYa is a passionate digital marketer, website optimizer, content creator, and a fully qualified web developer helping businesses of all sizes (big or small) to achieve better results online. We are a reputable and registered Australian business serving valued clients worldwide since 2008, built on hard work, honesty and providing exceptional personalized service

We love sharing our passion through freely available how to videos and courses related to business website marketing and optimization, Google (Search Console, Ads, Analytics, YouTube), SEO, HTML5, Structured Data and WordPress. Thank you for visiting our website. Rest assured that it will serve you well as well.

1 comment

Leave a comment

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