Forum archive
Need to upgrade to php 8.1/8.2
I'm needing to upgrade php7.4, which is now deprecated, to php8.1 on LAMP stack, Joomla4 Stack, orangeHRM stack, etc. I'm new to linux, and love turnkey approach. It's slick.
Can I do this from the command line, and if so, how?
The first question to ask yourself is do you actually need a newer version of PHP? Unless the software explicitly requires a newer version of PHP, it is recommended to just continue using PHP7.4.
The reason for that is that whilst 7.4 is EOL (end of life) from upstream (i.e. the PHP devs themselves), it is maintained in Debian (and other Linux distros). You will get backported security patches auto applied from the Debian repos. So the security of PHP itself shouldn't be a consideration in your choice whether to upgrade to newer PHP or not.
Some software "warns" that PHP 7.4 is EOL and/or that you can get better performance, etc if you upgrade PHP. There may be some legitimacy to those performance claims, but in my personal experience, there is no noticeable performance improvement 7.4 vs 8.x (as there was between PHP5.6 & PHP7.x).
Having said that, many recent PHP projects actually have a hard requirement of PHP 8.0+. I.e. some software just won't work with anything lower than PHP8.0. In those cases, updating PHP is the only option. AFAIK, all the appliances that we provide that require newer PHP, come with it (usually PHP8.1) pre-installed. E.g. Nextcloud, Invoice Ninja", Bookstack, and others.
If you want/need to update PHP, then there is a trusted third party repo that we use: https://deb.sury.org/. It contains very basic instructions, plus there are a number of forum threads that cover the process, but this recent one provides some links to other threads on what is required. As noted there, you will find a myriad of other sources, any related to Debian should apply directly to TurnKey.
Sorry that I'm not more explicit about the required steps, but hopefully that's enough to get you going. If you have problems and/or can't get it working as required, please post back and I'll do my best to assist. It's relatively straight forward, but there are a few reasons why it might not "just work".