Answer the question
In order to leave comments, you need to log in
How to install php-pgsql client on php:7.1-cli container?
Good afternoon,
The postgres container itself is definitely working, connected, manipulated data through the Database manager . The problem is to make it friends with php{''|7.1}
Fragment docker-compose.yml
php-cli:
build: ${CONTAINERS_PATH}/php-cli
volumes:
- ${APP_PATH_HOST}:/var/www
environment:
- DB_CONNECTION=pgsql
- DB_PORT=5432
- DB_HOST=pgsql
tty: true
pgsql:
image: postgres:latest
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DATABASE=${DB_NAME}
ports:
- 54321:5432
volumes:
- ./storage/docker/postgres/:/docker-entrypoint-initdb.d/
FROM php:7.1-cli
RUN apt-get update && apt-get install -y libmcrypt-dev php-pgsql; ## или php7.1-pgsql, тот же результат
RUN docker-php-ext-install mcrypt pcntl pdo pdo_pgsql;
WORKDIR /var/www
docker-compose-up
: FROM php:7.1-cli
RUN apt-get update && apt-get install -y libmcrypt-dev;
RUN docker-php-ext-install mcrypt pcntl pdo pdo_pgsql;
WORKDIR /var/www
Answer the question
In order to leave comments, you need to log in
I solved this problem like this
RUN set -ex \
&& echo "deb http://ftp.de.debian.org/debian stretch main" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y php-pgsql
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question