8

I work on some old project (Laravel 4.2, php5.6, postgresql) and I wanna to set it up on docker - here is my dockerfile:

FROM php:5-apache

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

RUN apt-get update

RUN apt-get install -y \
    git \
    nano \
    libpng-dev \
    libmcrypt-dev \ 
    postgresql-dev \  
    zlib1g-dev \
    zip \
    unzip &&\
    a2enmod rewrite

RUN docker-php-ext-install pdo &&\
    docker-php-ext-install pdo_mysql &&\
    docker-php-ext-install pdo_pgsql &&\
    docker-php-ext-install zip &&\
    docker-php-ext-install gd &&\
    docker-php-ext-install pcntl &&\ 
    docker-php-ext-install mcrypt

# COPY php.ini /usr/local/etc/php/php.ini

I get following error:

E: Unable to locate package postgresql-dev

When I change postgresql-dev to postgresql (and change image to FROM php:5-apache-jessie with different combinations: RUN dpkg --configure -a && RUN apt-get -f install && apt-get update && apt-get upgrade -y && apt-get --purge remove postgresql\* I get errors like:

E: Sub-process /usr/bin/dpkg returned an error code (1)

E: Unable to locate package postgresql*

E: Couldn't find any package by glob 'postgresql*'

E: Couldn't find any package by regex 'postgresql*'

You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.

You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.

configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path

Question: How to install postgres php client drivers properly?

1 Answer 1

18

In dockerfile change postgresql-dev \ to

libpq-dev \
Sign up to request clarification or add additional context in comments.

1 Comment

The do it tomorrow ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.