title: How to install pgsql driver on docker php:7.1-apache?
body: <p>I have an API Platform project with a postgresql DB and I can't find how to enable pdo pgsql driver with docker..</p>
  
  <p>Here is my docker file :</p>
  
  <pre><code>FROM php:7.1-apache
  
  # PHP extensions
  ENV APCU_VERSION 5.1.7
  RUN apt-get update \
      &amp;&amp; apt-get install -y --no-install-recommends \
      libicu-dev \
      zlib1g-dev \
      libpq-dev \
      libzip-dev \
      libpcre3-dev \
      ssmtp vim git cron zip \
      &amp;&amp; docker-php-ext-install \
      pdo \
      pdo_pgsql \
      zip
  
  # Apache config
  RUN a2enmod rewrite
  ADD docker/apache/vhost.conf /etc/apache2/sites-available/000-default.conf
  
  # Add the application
  ADD . /app
  WORKDIR /app
  
  # Install composer
  RUN ./docker/composer.sh \
      &amp;&amp; mv composer.phar /usr/bin/composer \
      &amp;&amp; composer global require "hirak/prestissimo:^0.3"
  
  RUN usermod -u 1000 www-data
  #RUN chown -R www-data:www-data /app/var/cache /app/var/logs /app/var/sessions
  
  CMD ["/app/docker/start.sh"]
  </code></pre>
  
  <p>and here my docker-composer.yml file</p>
  
  <pre><code>web:
      container_name: web-api-front
      build: .
      environment:
          SYMFONY_ENV: dev
      volumes:
          - .:/app
      ports:
          - 8084:80
  
  psql:
      container_name: psql-api-front
      image: postgres
      environment:
          POSTGRES_PASSWORD: ''
          POSTGRES_USER: dbuser
          POSTGRES_DB: dbname
      ports:
          - "5433:5432"
      volumes:
          - ./docker/sql:/var/sql
  </code></pre>
  
  <p>I've tryed a lot of websites but I still can't find a way to enable pgsql..</p>
  
  <p>When I do </p>
  
  <pre><code>var_dump(PDO::getAvailableDrivers());
  </code></pre>
  
  <p>I only have</p>
  
  <pre><code>array(2) { [0]=&gt; string(6) "sqlite" [1]=&gt; string(5) "mysql" }
  </code></pre>
  
  <p>Also, when I run</p>
  
  <pre><code>docker-compose up
  </code></pre>
  
  <p>I have this in my log, i'm not sure about what this mean</p>
  
  <pre><code>psql-api-front | LOG:  database system was shut down at 2017-08-01 08:18:57 UTC
  psql-api-front | LOG:  MultiXact member wraparound protections are now enabled
  psql-api-front | LOG:  database system is ready to accept connections
  psql-api-front | LOG:  autovacuum launcher started
  </code></pre>
  
  <p>What am I doing wrong ?</p>