Sun56shinE

PHP Update Required

Recommended Posts

I hadn't logged into my Wordpress dashboard for one of my sites in a while and noticed the "PHP Update Required". It is running on a very old version: 5.6.

While I know it redirects automatically via CloudLinux, should I still update it manually to a newer version? There is nothing extraordinary about the site, just wondering what hazards I might encounter. I am aware that some extensions are not available in newer versions but I don't know much about PHP and don't want to break anything.

Also, I will be building a new WordPress site shortly, how do I ensure it uses the newest PHP version and is there a way to have it update automatically when a new version is released? Or would this not be a recommended idea?

Any input would be greatly appreciated.

Thanks kindly!

Share this post


Link to post
Share on other sites

Good afternoon! You can modify your accounts PHP version directly through cPanel using the "Select PHP Version" interface. We currently offer up to version 7.4, and we recommend running version at least 7.3 assuming your software supports it. You mentioned running WordPress which does run fine on both 7.3 and 7.4, so assuming your plugins and themes are compatible you should be safe to upgrade. If needed you can revert back to an older version if you do experience issues with your sites after changing.

Once that change is made all sites under your account will start using that new version, including the new WP site you're building. As for automatically changing PHP versions once they're released unfortunately that's not a feature we can offer at the moment so you would still need to manually change once newer versions are made available.

Share this post


Link to post
Share on other sites

Good afternoon! Thanks for the speedy reply as always!

I switched to 7.3 under "Select PHP Version" but when I checked the site in question under "MultiPHP Manager" it was still showing as 5.6. When I changed it to 7.3 under "MultiPHPManger" I received an error regarding MySql extension (see attached).

Also, note screen shot of "MultiPHP Manager". 7.4 is only available as "alt" and not "ea". I thought I had read that "ea" was preferable.

I switched site back to 5.6 under "MultiPHP Manager" so site is running again.

Under "Select PHP Version", the default is set to 7.3.

The site is running one of the default WordPress themes (recently updated) and no plugins at the moment. Would I assume then that this theme is not compatible? Or is something else going on here?

Thanks again!

 

 

MySQL.png

MultiPHPManager.png

Share this post


Link to post
Share on other sites

I noticed this in the .htaccess:

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

I am guessing that is the problem?

 

Share this post


Link to post
Share on other sites

I figured out a fix but I don't know if it is the correct one!

I tried to enable mysqli extension for 7.3 but it wouldn't save. I tried on 7.4 and it did save.

Then I went to the multiphp manager and selected alt-7.4 (ea-7.4 not avail.)

That resolved the error but was it the correct way?

Thanks,

Share this post


Link to post
Share on other sites

So everything seems to be working with my fix above. Can anyone confirm this is a reasonable fix?

Also, wondering about that entry in the .htaccess? Doesn't that switch the php version back to 5.6? Does that increase security vulnerabilities?

Thanks,

Share this post


Link to post
Share on other sites

As no one official is helping you, I will advise.

 

Personally I don't use the PHP selector options in cPanel as, like you have found, they are confusing and needlessly messy.  Like two versions of each PHP version... ea and alt.

All I do is at the top of the htaccess file for each site is add the following line (for PHP 7.4 in my case)

AddHandler application/x-httpd-php74 .php .php5 .php4 .phtml

For version 7.3 for example, just change the 74 to 73 for example. For php 5.6, change it to 56.

 

In your case though, what I would do is remove the cpanel generated code your posted

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit 

 

And then create a phpinfo file in the same directory and Wordpress and see what version it shows.

https://make.wordpress.org/support/handbook/appendix/creating-a-phpinfo-page/

This will show the version you are using.  If it says a version you don't want to use, try my method above rather than trying anything through these version selectors.

 

Hope this helps

Share this post


Link to post
Share on other sites

Thanks Fowler, I will give that a try. I have also discovered an issue with the "site health status" through WordPress dashboard, which has changed since I changed the php versions. I will make a new post for that so it doesn't get buried here.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...