Upgrade PHP version in project from 5.6 to 8.1

17k Views Asked by At

I need to upgrade PHP version of my project. It is PHP5.6 and I want to upgrade it to PHP8.1. I tried to search for such information but couldn't find it, thus, I want to ask. Is it better to upgrade directly from PHP5.6 to PHP8.1, or step by step (PHP5.6 -> PHP7.0, PHP7.0 -> PHP7.1, PHP7.1->PHP7.2 and etc until I reach PHP8.1)?

2

There are 2 best solutions below

0
svgta On BEST ANSWER

Upgrading step by step can help you to see what is deprecated by following the logs files and then review the code.

0
hawkEye On

I have recently been made aware of this tool which ostensibly makes this process much easier. Note that I have not used it myself and as such can't speak to how well it works. It looks to be a FOSS project though which is good.

Website: https://getrector.org/

Github: https://github.com/rectorphp/rector

Updating manually as per the guides provided by vee will likely give you better understanding of the benefit each upgrade offers as well as maintaining full control over your project.