docker-php-ext-install-尽管安装了扩展程序,仍然找不到源

时间:2018-10-09 12:51:03

标签: php docker

我正在尝试在docker PHP映像中安装扩展。我有以下Dockerfile:

FROM php:7.2-apache

RUN apt-get update

RUN apt-get install -y build-essential cmake g++ libboost-dev libboost-system-dev \
    libboost-filesystem-dev libexpat1-dev zlib1g-dev libxml2-dev \
    libbz2-dev libpq-dev libproj-dev \
    git sudo wget postgresql-server-dev-all python-pyosmium osmium-tool

RUN docker-php-ext-install dba
RUN docker-php-ext-install pgsql

RUN printf '<Directory "/srv/nominatim/Nominatim/build/website"> \n\
  Options FollowSymLinks MultiViews \n\
  AddType text/html   .php \n\
  DirectoryIndex search.php \n\
  Require all granted \n\
</Directory> \n\
\n\
Alias /nominatim /srv/nominatim/Nominatim/build/website \n' > /etc/apache2/conf-available/nominatim.conf

RUN a2enconf nominatim
RUN service apache2 stop
RUN service apache2 start

WORKDIR /srv/nominatim
RUN wget https://nominatim.org/release/Nominatim-3.2.0.tar.bz2
RUN tar xf Nominatim-3.2.0.tar.bz2
RUN mv Nominatim-3.2.0 Nominatim

WORKDIR /srv/nominatim/Nominatim
RUN mkdir build

WORKDIR /srv/nominatim/Nominatim/build
RUN cmake ..
RUN make

RUN tee settings/local.php << $"EOF \n\
<?php \n\
 @define('CONST_Website_BaseURL', '/nominatim/'); \n\
EOF"

问题是,尽管安装了扩展名,并且phpinfo列出了它们的ini文件,但该扩展名不起作用:

Warning: require_once(DB.php): failed to open stream: No such file or directory in /srv/nominatim/Nominatim/lib/db.php on line 3

Fatal error: require_once(): Failed opening required 'DB.php' (include_path='.:/usr/local/lib/php') in /srv/nominatim/Nominatim/lib/db.php on line 3

尽管扩展名似乎已安装,但似乎.DB.php确实根本不存在(或者我找不到它们),因为.so文件也位于该位置。

编辑:我已经粘贴了上面的完整Dockerfile。我实际上是在尝试构建Nominatim图像,该图像将与另一个包含OSM数据的PostgreSQL图像组成。

0 个答案:

没有答案