gpt4 book ai didi

postgresql 客户端 - 在 php :5-apache 上安装

转载 作者:行者123 更新时间:2023-11-29 13:13:17 26 4
gpt4 key购买 nike

我在做一些旧项目(Laravel 4.2、php5.6、postgresql),我想在 docker 上设置它 - 这是我的 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

我收到以下错误:

E: Unable to locate package postgresql-dev

当我将 postgresql-dev 更改为 postgresql(并使用不同的组合将图像更改为 FROM php:5-apache-jessie 时:RUN dpkg --configure -a && RUN apt-get -f install && apt-get update && apt-get upgrade -y && apt-get --purge remove postgresql\* 我收到如下错误:

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

问题:如何正确安装postgres php客户端驱动?

最佳答案

dockerfile 中将 postgresql-dev\ 更改为

libpq-dev \

关于postgresql 客户端 - 在 php :5-apache 上安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52101865/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com