Last active
June 7, 2025 03:48
-
-
Save ben-albon/3c33628662dcd4120bf4 to your computer and use it in GitHub Desktop.
Docker PHP Image with PostgreSQL Driver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Thanks ๐
Dude, thanks very much!
Works also on PHP 8.0 ๐
Works also on PHP 8.1, thanks
very much!!
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
big thanks!
my dockerfile:
FROM php:8.3.20-bullseye
RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql
COPY . /app
WORKDIR /app
CMD [ "php", "-S", "0.0.0.0:20000", "-t", "public" ]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
so good!