We help IT Professionals succeed at work.

What Wordpress Changes Do I Need to Make After Upgrading PHP?

Tessando
Tessando asked
on
I have a WordPress site running a LAMP stack in AWS (Amazon Linux).

The version of PHP I have is:

PHP 7.0.33 (cli) (built: Jan  9 2019 22:04:26) ( NTS )

Open in new window


I noticed that the latest version of PHP is 7.3, available via the AWS Package Manager as:

sudo yum install -y php73

Open in new window


If I was to install this version of PHP are there any WordPress Configuration changed I'd need to make?

Thanks!
Comment
Watch Question

Most Valuable Expert 2018
Distinguished Expert 2019

Commented:
Hi,

Generally for WordPress - no, you wouldn't need to make any changes. WordPress works perfectly well with 7.3. However, outside of Core WordPress you'll have themes (along with their functions), and plug-ins. There could be issues with any of those. If you're using up-to-date plug-ins and themes then it's unlikely you'll have any problems, but there's no guarantee.

The full, technical way forward is to run your code (specifically the plug-ins and themes) through a PHP Compatibility checker, but that's quite a detailed, technical way forward, and you'd need to be fairly comfortable working at the terminal (SSH into your AWS instance).

If possible, whenever performing upgrades like this, it's often better to do the upgrades on a staging (non-production) site first so you can check for any issues.
Fractional CTO
Distinguished Expert 2019
Commented:
Generally, if you have a concern, you should check your code first... before upgrading...

If you just upgrade without checking, you can end up with a dead site.

https://www.experts-exchange.com/questions/29150594/Updating-website-page-to-PHP-7.html provides instructions for installing + running phpcs across one or many sites.

As Chris mentioned WordPress works up through PHP-7.4.2.6 (today's latest stable version) I'm running across 1000s of sites.

Also as Chris said, the real question is about themes + plugins.

If you use themes + plugins living in the WordPress repository, then you're usually good, as all themes + plugins must pass phpcs tests before they're allowed to be deployed through the repository.
Michael HurleyWeb Geek

Commented:

Hi Tessando,

(From David:)  ' Also as Chris said, the real question is about themes + plugins.'


In my humble experience this is where 99% of potential issues will lie...the PHP + WordPress marriage can be counted on to remain stable through main releases because that relationship is so strongly supported by both sides---doesn't mean its bullet-proof, I'm just saying any volatility that I've experience has always come from short-coded themes and/or 3rd party plug ins...So I would test and check documentation on those (and eliminate any you don't need or no longer use).

You can also check with your hosting provider for tips and info relating to this particular PHP release as it may relate to your hosted site.  They may well have a video or some documentation to help you, but if they don't, you are in great hands with the Experts already on this thread--I go to them myself regularly!!!

Thanks!

Mike

E-E, HelpDesk

David FavorFractional CTO
Distinguished Expert 2019

Commented:
As Michael said, most WordPress installs survive PHP updates... if and only if... they use code from the WordPress repository.

All the WordPress + PHP problems I've seen occur from using 3rd party software, which includes custom build themes + plugins.

Most custom built themes + plugins are built by people who's goal is to produce code to meet a current design, with no consideration to future WordPress or PHP changes.

If you stick to using WordPress repository code, it's very rare you'll ever have a WordPress + PHP problem to debug.
TessandoIT Administrator

Author

Commented:
Thanks Everyone. I was able to get PHP upgraded and there was only one WordPress Plugin that didn't place nicely. Of course, after I upgraded the Activation for it (which incurred a cost), it worked as expected!

Thanks everyone for your help. I value you guys and the vast depth of knowledge you share with the world. Thank you!
David FavorFractional CTO
Distinguished Expert 2019

Commented:
You're welcome!