When and what to upgrade?

I have installed Apache, MySQL and PHP. I'd like to know when and what to upgrade, generally speaking.

For example, I'm running PHP 7.0. Is there any reason to upgrade to the iterative versions 7.1, 7.1.1, etc, or does it make more sense to wait until the next major release like 8.0?

I'm being pragmatic here, but unless I'm having instability issues or there are big security vulnerabilities, is it really worth it?

Security would be the biggest reason to upgrade, but you need to make sure your code base is ready for the newer versions. Going from 7.1 to 7.1.1 should not have anything more than security or bug fixes. Staying a version back from the latest release is a good idea, or at least don't update on release day. Too often do we see buggy software getting released, although it generally is safe to install updates through your package manager as they should be tested to work with your OS.

If you were to ask me what version of Nginx is running on my server, I couldn't tell you. I just let the package manager update it for me.

2 Likes

While this is generally true, PHP had some minor-releases in the past that did break code bases (there's not been any in a while, but just be aware). They did get better at this though.

Generally, I'd always develop with the version that your target system is actually using in production. It so happens that a lot of webhosters run older versions of PHP. And while it is nice to have the latest stuff at home and be up to date while developing, that doesn't exactly help you when you're deploying and nothing works. The same goes for config variables by the way (and PHP is a damn PITA about that).

Probably the best choice, but nginx doesn't have the impact a "wrong" PHP version does when deploying :wink:

1 Like

Thank you both. Here's a follow up question. Once development is finished and everything is pushed to production, unless there are gaping security vulnerabilities that arise, how often do people generally wait until they begin upgrading their production site to newer versions of everything?

TL;DR: As soon as possible, as late as necessary.

Assuming you actually have control over the PHP version on your server there is no reason to wait all that long.

Make sure your product/application is actually working on the newer PHP version locally and you're good to go with the upgrade. Generally speaking if you avoid using deprecated functions in your application you should be fine, but do still run tests of everything you can think of (good documentation helps a lot).

If you don't have control over the PHP version (like a shared hoster), still test your application against the latest PHP versions (well, both of course actually) so you don't get overrun when the hoster decides to upgrade.

If you can set up a CI Enviroment that's also great of course, since you can test against both simultaneously.

1 Like

Sounds good. Thanks.

Thanks for the information guys , It was really helpful :)