php extension enable, missing extension=pdo or all pro extensions should be absent
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php-defaults (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
lsb_release -rd
Description: Ubuntu 22.04.2 LTS
Release: 22.04
apt-cache policy php
php:
Installed: 2:8.1+92ubuntu1
Candidate: 2:8.1+92ubuntu1
Version table:
*** 2:8.1+92ubuntu1 500
500 http://
100 /var/lib/
The php.ini file includes:
;extension=
;extension=
;extension=
;extension=
;extension=
;extension=
If a user enables one of these (removes the ";") then they will get an "undefined symbol: php_pdo_
10-pdo.ini -> /etc/php/
20-pdo_sqlite.ini -> /etc/php/
If "phpenmod" is used to enable both pdo and, e.g. pro_sqlite, then the php.ini entries are not
necessary. If they are used used then a warning is issued about duplicate module init. Also, if the php.ini entries are used then the extension=pdo template entry is missing. Alternatively, the "extension=" entries in php.ini could be entirely removed and a comment added instructing users to use the "phpenmod" command.
Ideally, what I expect as a user in this case is to open php.ini file and to find a comment indicating that module configuration has changed and that users should use use "phpenmod" instead. That will help direct those migrating from an earlier php version.
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: php 2:8.1+92ubuntu1
ProcVersionSign
Uname: Linux 5.15.0-69-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.3
Architecture: amd64
CasperMD5CheckR
Date: Wed Apr 5 09:14:28 2023
PackageArchitec
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: php-defaults
UpgradeStatus: No upgrade log present (probably fresh install)
Hello James and thanks for this bug report. I can see how those commented extension lines can be confusing, given that phpenmod should be preferred.
This issue is present in Debian too, and ideally it should be fixed there. This way Debian and downstream distributions other than Ubuntu will also benefit from the change, and we won't have to carry over a diff with respect to Debian, with the associated maintenance overhead.
Would you mind filing a bug with Debian please? Note that Debian already packages php8.1. Thanks!