It is not possible for me to install the php-pgsql (virtual) module in a cointainer based on the official image wordpress:8.2
In theory, as the container runs a debian12 bookworm code shouldn't be any problem. The installation should be as trivial as run this code
root@a1cc7e9211ce:/var/www/html# apt update && apt install php8.2-pgsql
but it fails
root@a1cc7e9211ce:/var/www/html# apt install php8.2-pgsql
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package php8.2-pgsql is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'php8.2-pgsql' has no installation candidate
Sorting... Done
Full Text Search... Done
The surprising fact is that the package is present
root@a1cc7e9211ce:/var/www/html# apt search php8.2-pgsql
Sorting... Done
Full Text Search... Done
php8.2-pgsql/bookworm 8.2.15-1+0~20240120.39+debian12~1.gbp56f296 amd64
(none)
I want to clarify that the apt install php8.2-pgsql command fails despite the package being present in the repository.
So my question is:
is there any limitation in the version of the php used in the image of wordpress:8.2 I'm using? why couldn't and how could I install the php-pgsql module in the container?
does exist a version of wordpress image with the php-pgsql module already installed?
And (as a workaround): I use a second container (with wp_CLI) to install wordpress in the first container. Can I manually download the wp code in the first container (so I would have a standard Debian12 installation) and then install the wp using a wp_cli as done now?
As you can imagine, manually downloading the WordPress code and installing it with WP-CLI would be a workaround, but it would require more effort than simply installing the php-pgsql module. So I would prefer just to install the module...
I hope my question is clear.
Try this 🗎 Dockerfile
:
FROM wordpress:php8.2
RUN apt update -q && \
apt install -q -y libpq-dev && \
docker-php-ext-install pdo_pgsql pgsql
Launch a container and check what modules installed via the PHP CLI: