Skip to content

Instantly share code, notes, and snippets.

@ben-albon
Last active October 4, 2024 08:30
Show Gist options
  • Save ben-albon/3c33628662dcd4120bf4 to your computer and use it in GitHub Desktop.
Save ben-albon/3c33628662dcd4120bf4 to your computer and use it in GitHub Desktop.
Docker PHP Image with PostgreSQL Driver
FROM php:5.6-apache
RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql
COPY src/ /var/www/html
@kharbanda14
Copy link

Thanks a lot !!

@aspirebj
Copy link

aspirebj commented May 4, 2020

FROM php:7.4.2-apache-buster
RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql``

@richb201
Copy link

richb201 commented Jun 6, 2020

My Dockerfile uses "FROM bitnami/php-fpm:7.2" rather than the Apache container. So I will use

FROM bitnami/php-fpm:7.2
RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql

Is this doomed to failure?

@CDRO
Copy link

CDRO commented Jun 8, 2020

My Dockerfile uses "FROM bitnami/php-fpm:7.2" rather than the Apache container. So I will use

FROM bitnami/php-fpm:7.2
RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql

Is this doomed to failure?

This could work but you'd have to ensure that your apache handles requests to php though PHP-FPM

@denjakah
Copy link

thank brow! 👍

@edocollado
Copy link

Thanks 🚀

@bigbear1989
Copy link

so good!

@MMierzynski
Copy link

Thanks 👍

@brutalzinn
Copy link

Dude, thanks very much!

@alfredbez
Copy link

Works also on PHP 8.0 👍

@silasstoffel
Copy link

Works also on PHP 8.1, thanks

@sidneyn
Copy link

sidneyn commented Oct 18, 2023

very much!!

@G3NSVRV
Copy link

G3NSVRV commented Apr 21, 2024

php:8-apache

3.563 E: Unable to locate package docker-php-ext-install
3.563 E: Unable to locate package pgsql
3.563 E: Unable to locate package pdo
3.563 E: Unable to locate package pdo_pgsql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment