The officially official Devuan Forum!

You are not logged in.

#1 2023-02-16 07:57:41

john2009w
Member
Registered: 2020-07-07
Posts: 21  

[HowTo] Install PHP 8.2 on Devuan Chimaera (stable)

Tested under a i686 install of Devuan Chimaera (stable) with runit init system and nginx server.

Devuan Chimaera has PHP 7.4 on repos which has been made EOL on November 2022 and should not be used. This guide explains a way to install PHP 8.2 on Chimaera.

NOTE: There are many applications which don't support PHP 8.2 yet. Please check all the application system requirements to be sure that everything will work. For example, the current Nextcloud release, version 25, does not support PHP 8.2, but only up to 8.1. Nextcloud 26 is going to be released on March 2023 and should have support for PHP 8.2. Another option is TDR repos which at the time of writing this has PHP 8.0.15 and 8.1.2 but only x64 and thus doesn't have i686 support.

WARNING: These instructions have not been tested extensively and I'm not experienced with this. Even though it has been running great on my machine, be sure to test it on staging environment thoroughly before serious use.

There are packages in daedalus (testing) and ceres (unstable) for PHP 8.2. So in this guide we're going to mix these packages from testing with stable. But we're going to do that in a process that does not ruin the stable experience. apt will see testing packages when we explicitly mention so. Otherwise it will see and install stable packages (unless some are installed from testing already). NOTE: If PHP 8.x becomes available in chimaera-backports in future (check here to see if chimaera-backports is mentioned under a 8.x package), using that instead may be a better idea. At the time of writing this, it is not the case.

I followed official Debian guide for "mixing" testing packages in stable and as much as I tested it worked fine for me. So if you're eager, read on...

Edit /etc/apt/apt.conf and add:

APT::Default-Release "chimaera";

Here we are setting the default release that we want apt to see when using apt normally. NOTE: You may need to change this when upgrading Devuan.

Edit /etc/apt/sources.list and add:

# To allow to mix packages from testing
deb http://deb.devuan.org/merged daedalus main contrib non-free
deb-src http://deb.devuan.org/merged daedalus main contrib non-free

Here we are enabling daedalus (currently testing) repos to install PHP 8.2 from. NOTE: You may need to change this when upgrading Devuan.

Now update to reflect changes:

sudo apt update

I noticed that when I try to apt upgrade, it tries to install linux-image from daedalus. But I want to keep linux-image from stable. I don't want any packages from testing unless I say so. So I had to set priorities for repositories by adding the following on /etc/apt/preferences to make sure this happens:

Package: *
Pin: release a=stable
Pin-Priority: 900

Package: *
Pin: release a=testing
Pin-Priority: 400

Now to install from testing, try things like:

apt search -t testing php-fpm
sudo apt-get -t testing install php-fpm php-mysql
# and so on...

You can also use repo name exclusively, for example, "-t daedalus". Carefully check what these commands install and if you are ok with them. And when running apt search carefully check from which repo it is seeing packages from. It should have the repo after the "package-name/" part, like "php7.4-fpm/stable,stable-security,now", "php8.2-fpm/testing,now". It should select "php8.2" series packages on the apt install command above if everything went well.

To confirm, run php --version:

$ php --version
PHP 8.2.2 (cli) (built: Feb  7 2023 11:27:52) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.2, Copyright (c) Zend Technologies
	with Zend OPcache v8.2.2, Copyright (c), by Zend Technologies

To install anything from stable, just drop the "-t testing" argument and use apt like you used before. Like "apt search nodejs" should show "nodejs/stable".

If anybody notices any issues with this guide feel free to respond below.

UPDATES:
1. Updated some URLs, change "php8.2", minor changes (20230216)

Last edited by john2009w (2023-02-16 08:24:07)

Offline

#2 2023-02-17 13:30:45

mckaygerhard
Member
Registered: 2017-04-21
Posts: 283  
Website

Re: [HowTo] Install PHP 8.2 on Devuan Chimaera (stable)

john2009w wrote:

Tested under a i686 install of Devuan Chimaera (stable) with runit init system and nginx server.

Devuan Chimaera has PHP 7.4 on repos which has been made EOL on November 2022 and should not be used.

i used php 5.6 and 7.3 "should not be used" .. pifff the problem with geek people its that confused security with fashion updates.. the excuse from upstream is security, but for that there are so many people working in such thing, like debian LTS with freexian repos

ALSO  mixing repos from unstable only works cos right now unstable and testing are very close in dependencies.. but this does not works as is.. so this guide is not so great neither secure ironically

Offline

#3 2023-02-19 09:08:54

john2009w
Member
Registered: 2020-07-07
Posts: 21  

Re: [HowTo] Install PHP 8.2 on Devuan Chimaera (stable)

mckaygerhard wrote:

i used php 5.6 and 7.3 "should not be used" .. pifff the problem with geek people its that confused security with fashion updates.. the excuse from upstream is security, but for that there are so many people working in such thing, like debian LTS with freexian repos

There could be vulnerabilities. 7.4 is just deprecated and what if new vulnerabilities emerge? And without official support this is a risk.

Even if someone patches things it could take more time to do. Why take the risk? This should not be forced on to all users at least. If someone has old code that needs 7.x that's fine. But users should be able to get out of an unsupported version. (I am not recommending this method for everyone as mentioned above and below, but rather have been requesting for a backport as a more logical solution.)

mckaygerhard wrote:

ALSO  mixing repos from unstable only works cos right now unstable and testing are very close in dependencies.. but this does not works as is.. so this guide is not so great neither secure ironically

I used testing, not unstable. Also understand that I had to do that as a last resort. TDR repos did not have i686 support. I did not recommend this for everyone (please check NOTEs and WARNINGs), rather recommended to check backports first. This is for people who are willing to take the risk of testing the setup. Didn't have any other way, this worked, was fairly stable, so thought of sharing it. If this may have any problems in future, please point that out as it should be sort of a warning to what someone is getting into.

This is why 8.x should be in backports so that I don't have to jump through hoops just to get out of an unsupported version.

Offline

#4 2023-02-22 12:33:28

mckaygerhard
Member
Registered: 2017-04-21
Posts: 283  
Website

Re: [HowTo] Install PHP 8.2 on Devuan Chimaera (stable)

john2009w wrote:
mckaygerhard wrote:

i used php 5.6 and 7.3 "should not be used" .. pifff the problem with geek people its that confused security with fashion updates.. the excuse from upstream is security, but for that there are so many people working in such thing, like debian LTS with freexian repos

There could be vulnerabilities. 7.4 is just deprecated and what if new vulnerabilities emerge? And without official support this is a risk.}

It seems you ignored so many tbhings.. and is clear you dont know what debian LTS means. so your sentences are pretty from ignorant

john2009w wrote:

I used testing, not unstable. Also understand that I had to do that as a last resort. TDR repos did not have i686 support. I did not recommend this for everyone (please check NOTEs and WARNINGs), rather recommended to check backports first. This is for people who are willing to take the risk of testing the setup. Didn't have any other way, this worked, was fairly stable, so thought of sharing it. If this may have any problems in future, please point that out as it should be sort of a warning to what someone is getting into.

This is why 8.x should be in backports so that I don't have to jump through hoops just to get out of an unsupported version.

another sing of ignorant, currently unstable can work into testing cos dependencies between repos are "close", but that not will always work..

the same can be done between testing and stable, but as same, only when both are close, if stable its older its not so possible..

Offline

Board footer