Bullseye: after php8.3 install, php7.4 still running

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
lzbk
Posts: 2
Joined: 2025-01-21 14:37

Bullseye: after php8.3 install, php7.4 still running

#1 Post by lzbk »

I have a problem analogous to the one described here.

I had php7.4 running well. I installed php8.3 (using the sury repo), I tried to install all the 7.4 counterpart in 8.3 :

Code: Select all

sudo apt list --installed | grep -i php
gives:

Code: Select all

libapache2-mod-php7.4/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64 [installé, pouvant être supprimé automatiquement]
libapache2-mod-php8.3/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 amd64  [installé]
php-bz2/oldstable,now 2:7.4+76 all [installé, pouvant être mis à jour vers : 2:8.3+95+0~20240927.54+debian11~1.gbpe0084c]
php-cli/bullseye,now 2:8.3+95+0~20240927.54+debian11~1.gbpe0084c all  [installé, automatique]
php-common/bullseye,now 2:95+0~20240927.54+debian11~1.gbpe0084c all  [installé, automatique]
php-composer-ca-bundle/oldstable,now 1.2.9-1 all  [installé, automatique]
php-composer-semver/oldstable,now 3.2.4-2 all  [installé, automatique]
php-composer-spdx-licenses/oldstable,now 1.5.5-2 all  [installé, automatique]
php-composer-xdebug-handler/oldstable,now 1.4.5-1+deb11u1 all  [installé, automatique]
php-curl/oldstable,now 2:7.4+76 all [installé, pouvant être mis à jour vers : 2:8.3+95+0~20240927.54+debian11~1.gbpe0084c]
php-gd/oldstable,now 2:7.4+76 all [installé, pouvant être mis à jour vers : 2:8.3+95+0~20240927.54+debian11~1.gbpe0084c]
php-google-recaptcha/oldstable,now 1.2.4-3 all  [installé, automatique]
php-intl/oldstable,now 2:7.4+76 all [installé, pouvant être mis à jour vers : 2:8.3+95+0~20240927.54+debian11~1.gbpe0084c]
php-json-schema/oldstable,now 5.2.10-2 all  [installé, automatique]
php-mariadb-mysql-kbs/oldstable,now 1.2.12-1 all  [installé, automatique]
php-mbstring/oldstable,now 2:7.4+76 all [installé, pouvant être mis à jour vers : 2:8.3+95+0~20240927.54+debian11~1.gbpe0084c]
php-mysql/oldstable,now 2:7.4+76 all [installé, pouvant être mis à jour vers : 2:8.3+95+0~20240927.54+debian11~1.gbpe0084c]
php-phpmyadmin-motranslator/oldstable,now 5.2.0-1 all  [installé, automatique]
php-phpmyadmin-shapefile/oldstable,now 2.1-5 all  [installé, automatique]
php-phpmyadmin-sql-parser/oldstable,now 5.4.1-1 all  [installé, automatique]
php-phpseclib/oldstable,now 2.0.30-2+deb11u2 all  [installé, automatique]
php-psr-cache/oldstable,now 1.0.1-2 all  [installé, automatique]
php-psr-container/oldstable,now 1.0.0-2 all  [installé, automatique]
php-psr-log/oldstable,now 1.1.3-2 all  [installé, automatique]
php-react-promise/oldstable,now 2.7.0-2 all  [installé, automatique]
php-symfony-cache-contracts/oldstable,now 1.1.10-2+deb11u1 all  [installé, automatique]
php-symfony-cache/oldstable,now 4.4.19+dfsg-2+deb11u6 all  [installé, automatique]
php-symfony-config/oldstable,now 4.4.19+dfsg-2+deb11u6 all  [installé, automatique]
php-symfony-console/oldstable,now 4.4.19+dfsg-2+deb11u6 all  [installé, automatique]
php-symfony-dependency-injection/oldstable,now 4.4.19+dfsg-2+deb11u6 all  [installé, automatique]
php-symfony-expression-language/oldstable,now 4.4.19+dfsg-2+deb11u6 all  [installé, automatique]
php-symfony-filesystem/oldstable,now 4.4.19+dfsg-2+deb11u6 all  [installé, automatique]
php-symfony-finder/oldstable,now 4.4.19+dfsg-2+deb11u6 all  [installé, automatique]
php-symfony-polyfill-php80/oldstable,now 1.22.1-1 all  [installé, automatique]
php-symfony-process/oldstable,now 4.4.19+dfsg-2+deb11u6 all  [installé, automatique]
php-symfony-service-contracts/oldstable,now 1.1.10-2+deb11u1 all  [installé, automatique]
php-symfony-var-exporter/oldstable,now 4.4.19+dfsg-2+deb11u6 all  [installé, automatique]
php-symfony-yaml/oldstable,now 4.4.19+dfsg-2+deb11u6 all  [installé, automatique]
php-tcpdf/oldstable,now 6.3.5+dfsg1-1 all  [installé, automatique]
php-twig-i18n-extension/oldstable,now 3.0.0-2 all  [installé, automatique]
php-twig/oldstable-security,now 2.14.3-1+deb11u3 all  [installé, automatique]
php-xml/oldstable,now 2:7.4+76 all [installé, pouvant être mis à jour vers : 2:8.3+95+0~20240927.54+debian11~1.gbpe0084c]
php-zip/oldstable,now 2:7.4+76 all [installé, pouvant être mis à jour vers : 2:8.3+95+0~20240927.54+debian11~1.gbpe0084c]
php7.4-bz2/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64  [installé, automatique]
php7.4-cli/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64  [installé, automatique]
php7.4-common/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64  [installé, automatique]
php7.4-curl/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64  [installé, automatique]
php7.4-gd/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64  [installé, automatique]
php7.4-intl/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64  [installé, automatique]
php7.4-json/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64  [installé, automatique]
php7.4-mbstring/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64  [installé, automatique]
php7.4-mysql/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64  [installé, automatique]
php7.4-opcache/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64  [installé, automatique]
php7.4-readline/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64  [installé, automatique]
php7.4-xml/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64  [installé, automatique]
php7.4-zip/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c amd64  [installé, automatique]
php7.4/bullseye,now 1:7.4.33-18+0~20241224.97+debian11~1.gbpaac02c all [installé, pouvant être supprimé automatiquement]
php8.3-bz2/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 amd64  [installé]
php8.3-cli/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 amd64  [installé]
php8.3-common/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 amd64  [installé]
php8.3-curl/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 amd64  [installé]
php8.3-gd/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 amd64  [installé]
php8.3-intl/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 amd64  [installé]
php8.3-mbstring/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 amd64  [installé]
php8.3-mysql/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 amd64  [installé]
php8.3-opcache/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 amd64  [installé]
php8.3-readline/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 amd64  [installé]
php8.3-xml/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 amd64  [installé]
php8.3-zip/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 amd64  [installé]
php8.3/bullseye,now 8.3.16-1+0~20250119.51+debian11~1.gbpd60bd2 all  [installé]
php/bullseye,now 2:8.3+95+0~20240927.54+debian11~1.gbpe0084c all  [installé]
phpmyadmin/oldstable,now 4:5.0.4+dfsg2-2+deb11u1 all  [installé]
I have run

Code: Select all

sudo update-alternatives --config php
(I tried to do the same with phar) so that when I type

Code: Select all

php -v
I get :

Code: Select all

PHP 8.3.16 (cli) (built: Jan 19 2025 13:29:55) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.16, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.16, Copyright (c), by Zend Technologies
But when I open a page with

Code: Select all

phpinfo();
I get :
titlevalue
Configuration File (php.ini) Path/etc/php/7.4/apache2
Loaded Configuration File/etc/php/7.4/apache2/php.ini
Scan this dir for additional .ini files/etc/php/7.4/apache2/conf.d
Additional .ini files parsed/etc/php/7.4/apache2/conf.d/10-mysqlnd.ini, /etc/php/7.4/apache2/conf.d/10-opcache.ini, /etc/php/7.4/apache2/conf.d/10-pdo.ini, /etc/php/7.4/apache2/conf.d/15-xml.ini, /etc/php/7.4/apache2/conf.d/20-bz2.ini, /etc/php/7.4/apache2/conf.d/20-calendar.ini, /etc/php/7.4/apache2/conf.d/20-ctype.ini, /etc/php/7.4/apache2/conf.d/20-curl.ini, /etc/php/7.4/apache2/conf.d/20-dom.ini, /etc/php/7.4/apache2/conf.d/20-exif.ini, /etc/php/7.4/apache2/conf.d/20-ffi.ini, /etc/php/7.4/apache2/conf.d/20-fileinfo.ini, /etc/php/7.4/apache2/conf.d/20-ftp.ini, /etc/php/7.4/apache2/conf.d/20-gd.ini, /etc/php/7.4/apache2/conf.d/20-gettext.ini, /etc/php/7.4/apache2/conf.d/20-iconv.ini, /etc/php/7.4/apache2/conf.d/20-intl.ini, /etc/php/7.4/apache2/conf.d/20-json.ini, /etc/php/7.4/apache2/conf.d/20-mbstring.ini, /etc/php/7.4/apache2/conf.d/20-mysqli.ini, /etc/php/7.4/apache2/conf.d/20-pdo_mysql.ini, /etc/php/7.4/apache2/conf.d/20-phar.ini, /etc/php/7.4/apache2/conf.d/20-posix.ini, /etc/php/7.4/apache2/conf.d/20-readline.ini, /etc/php/7.4/apache2/conf.d/20-shmop.ini, /etc/php/7.4/apache2/conf.d/20-simplexml.ini, /etc/php/7.4/apache2/conf.d/20-sockets.ini, /etc/php/7.4/apache2/conf.d/20-sysvmsg.ini, /etc/php/7.4/apache2/conf.d/20-sysvsem.ini, /etc/php/7.4/apache2/conf.d/20-sysvshm.ini, /etc/php/7.4/apache2/conf.d/20-tokenizer.ini, /etc/php/7.4/apache2/conf.d/20-xmlreader.ini, /etc/php/7.4/apache2/conf.d/20-xmlwriter.ini, /etc/php/7.4/apache2/conf.d/20-xsl.ini, /etc/php/7.4/apache2/conf.d/20-zip.ini
Now I tried :

Code: Select all

sudo a2enmod php8.3
sudo a2dismod php7.4
In this case

Code: Select all

sudo systemctl restart apache2
does not yield an error, but my page with phpinfo is blank and not even interpreted (the php code is visible inside it).

I don't really know what to do next (besides reverting to php7.4). Thanks for any help.

User avatar
donald
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 1470
Joined: 2021-03-30 20:08
Has thanked: 252 times
Been thanked: 312 times

Re: Bullseye: after php8.3 install, php7.4 still running

#2 Post by donald »

Can you share the output of:

Code: Select all

update-alternatives --config php
(shows what is available

Code: Select all

update-alternatives --config php-fpm
(shows what is available)

Code: Select all

service --status-all | grep php
(shows which services are available)
Typo perfectionish.


"The advice given above is all good, and just because a new message has appeared it does not mean that a problem has arisen, just that a new gremlin hiding in the hardware has been exposed." - FreewheelinFrank

reinob
Section Moderator
Section Moderator
Posts: 1265
Joined: 2014-06-30 11:42
Has thanked: 131 times
Been thanked: 62 times

Re: Bullseye: after php8.3 install, php7.4 still running

#3 Post by reinob »

somewhere in the apache configuration there will be the section where php is configured.
with nginx I have:

Code: Select all

upstream php-handler {
  server unix:/var/run/php/php8.2-fpm.sock;
}
you can have multiple versions of php installed, but you have to tell the web server which one to use. I don't think that the debian alternatives system takes care of that (but maybe I'm wrong).

reinob
Section Moderator
Section Moderator
Posts: 1265
Joined: 2014-06-30 11:42
Has thanked: 131 times
Been thanked: 62 times

Re: Bullseye: after php8.3 install, php7.4 still running

#4 Post by reinob »

add.: with apache I think you need to a2enconf php8.2-fpm.conf (or whatever).
or just make sure the right config file is linked to in /etc/apache2/conf-enabled/

User avatar
donald
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 1470
Joined: 2021-03-30 20:08
Has thanked: 252 times
Been thanked: 312 times

Re: Bullseye: after php8.3 install, php7.4 still running

#5 Post by donald »

reinob wrote: 2025-01-22 20:37 add.: with apache I think you need to a2enconf php8.2-fpm.conf (or whatever).
or just make sure the right config file is linked to in /etc/apache2/conf-enabled/
One can split the server php/apache-php/apache-cli along different php versions because they are each configured differently (call differently). I think you are correct that he needs to a2disconf/mod to the proper version.
Typo perfectionish.


"The advice given above is all good, and just because a new message has appeared it does not mean that a problem has arisen, just that a new gremlin hiding in the hardware has been exposed." - FreewheelinFrank

lzbk
Posts: 2
Joined: 2025-01-21 14:37

Re: Bullseye: after php8.3 install, php7.4 still running

#6 Post by lzbk »

Thank you so much to both of you for your replies.
reinob wrote: 2025-01-22 20:37 add.: with apache I think you need to a2enconf php8.2-fpm.conf (or whatever).
or just make sure the right config file is linked to in /etc/apache2/conf-enabled/
Indeed, as I explained in the original post, I do the following commands before I try the commands suggested by donald:

Code: Select all

sudo update-alternatives --set php /usr/bin/php8.3
sudo update-alternatives --set phar /usr/bin/phar8.3
sudo a2enmod php8.3
sudo a2dismod php7.4
sudo systemctl restart apache2
donald wrote: 2025-01-22 18:25

Code: Select all

update-alternatives --config php

Code: Select all

Il existe 3 choix pour l'alternative php (qui fournit /usr/bin/php).

  Sélection   Chemin                Priorité  État
------------------------------------------------------------
  0            /usr/bin/php.default   100       mode automatique
  1            /usr/bin/php.default   100       mode manuel
  2            /usr/bin/php7.4        74        mode manuel
* 3            /usr/bin/php8.3        83        mode manuel
donald wrote: 2025-01-22 18:25

Code: Select all

update-alternatives --config php-fpm

Code: Select all

update-alternatives: erreur: pas d'alternatives pour php-fpm
donald wrote: 2025-01-22 18:25

Code: Select all

service --status-all

Code: Select all

 [ - ]  apache-htcacheclean
 [ + ]  apache2
 [ + ]  apparmor
 [ - ]  console-setup.sh
 [ + ]  cron
 [ + ]  dbus
 [ - ]  hwclock.sh
 [ - ]  keyboard-setup.sh
 [ + ]  kmod
 [ - ]  lvm2
 [ - ]  lvm2-lvmpolld
 [ + ]  mariadb
 [ + ]  networking
 [ + ]  open-vm-tools
 [ + ]  procps
 [ - ]  rsync
 [ + ]  rsyslog
 [ + ]  ssh
 [ - ]  sudo
 [ + ]  udev
 [ + ]  unattended-upgrades
 [ - ]  x11-common
(except for the * before the alternative selected every command above returns the same whether I choose php7.4 or php8.3 — the only difference is that php scripts are not rendered when using php8.3 mod)

lzbk
Posts: 2
Joined: 2025-01-21 14:37

Re: Bullseye: after php8.3 install, php7.4 still running

#7 Post by lzbk »

NB : my test script is the following

Code: Select all

<!doctype html>
<html>
    <body>OK
    <?php
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
echo "ok";
phpinfo();
?>
    or not ?</body>
</html>
in php7.4 everything goes well, and in php8.3 the source code from the page is

Code: Select all

<html><head></head><body>OK
    <!--?php
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
echo "ok";
phpinfo();
?-->
    or not ?

</body></html>
Last edited by lzbk on 2025-01-23 10:14, edited 1 time in total.

User avatar
donald
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 1470
Joined: 2021-03-30 20:08
Has thanked: 252 times
Been thanked: 312 times

Re: Bullseye: after php8.3 install, php7.4 still running

#8 Post by donald »

I think you do not have php-fpm installed, hence your error from earlier.
update-alternatives: erreur: pas d'alternatives pour php-fpm
Install php-fpm and its dependencies:

Code: Select all

sudo apt install -y php-fpm
Activate the proxy in apache2

Code: Select all

sudo a2enmod proxy_fcgi setenvif
Activate the configuration for apache2:

Code: Select all

sudo a2enconf php8.2-fpm
Enable php-fpm to start at boot:

Code: Select all

sudo systemctl enable php8.2-fpm
Start php-fpm:

Code: Select all

sudo systemctl start php8.2-fpm
Check the status:

Code: Select all

sudo systemctl status php8.2-fpm
Enable the alternatives:

Code: Select all

update-alternatives --config php-fpm
It should now be present here:

Code: Select all

service --status-all | grep php
Restart apache2:

Code: Select all

sudo systemctl restart apache2
Typo perfectionish.


"The advice given above is all good, and just because a new message has appeared it does not mean that a problem has arisen, just that a new gremlin hiding in the hardware has been exposed." - FreewheelinFrank

reinob
Section Moderator
Section Moderator
Posts: 1265
Joined: 2014-06-30 11:42
Has thanked: 131 times
Been thanked: 62 times

Re: Bullseye: after php8.3 install, php7.4 still running

#9 Post by reinob »

lzbk wrote: 2025-01-23 10:05 Thank you so much to both of you for your replies.
reinob wrote: 2025-01-22 20:37 add.: with apache I think you need to a2enconf php8.2-fpm.conf (or whatever).
or just make sure the right config file is linked to in /etc/apache2/conf-enabled/
Indeed, as I explained in the original post, I do the following commands before I try the commands suggested by donald:

Code: Select all

sudo update-alternatives --set php /usr/bin/php8.3
sudo update-alternatives --set phar /usr/bin/phar8.3
sudo a2enmod php8.3
sudo a2dismod php7.4
sudo systemctl restart apache2
You can enable the module (a2enmod) but you must configure apache to use it (a2enconf).
I don't see a2enconf in what you've written, but read donald's post which explains it in more detail.

Post Reply