How to add a driver for PostgreSQL in docker container php-fpm?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
45 views
There is a Dockerfile like this:
FROM php:fpm RUN apt-get update && apt-get install -y \\ curl \\ wget \\ git \\ libfreetype6-dev \\ libjpeg62-turbo-dev \\ libmcrypt-dev \\ libpng-dev \\ && pecl install mcrypt-1.0.1 \\ && docker-php-ext-enable mcrypt \\ && docker-php-ext-install-j$(nproc) iconv mbstring mysqli pdo_mysql zip \\ && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \\ && docker-php-ext-install-j$(nproc) gd RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer ADD ./php.ini /usr/local/etc/php/conf.d/40-custom.ini WORKDIR /var/www CMD ["php-fpm"]

Tell me, what to change in deckerville to get php to work with postgres? I do not understand how to work with extensions for php in Docker. Just tried to change mysqli to pdo_mysql in pgsql and pdo_pgsql, but to no avail. And how to connect from php to the database, which is also located in the container? As usual localhost? Or is there some distinctive features? And the last question. I read that mcrypt is deprecated in deckerville to replace it with something relevant?
by | 45 views

1 Answer

0 like 0 dislike
RUN apt-get update && \\ apt-get install -y libpq-dev && \\ docker-php-ext-install pdo pdo_pgsql pgsql
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users