如何在php-apache Docker映像之上安装v8js

时间:2019-04-26 15:49:36

标签: php apache docker pecl v8js

我正在从官方php-apache映像构建自定义Docker映像,但是无法安装v8js PECL扩展。

我尝试运行与安装其他PECL扩展(例如xdebug)相同的命令,但是没有运气-构建失败,提示我需要安装v8发行版。我确实尝试使用我搜索过的一些Linux命令来这样做,但是我对Linux一点都不熟悉,所以我真的不知道该如何做。不幸的是,在这种情况下,php-apache开发人员提供的便利脚本无济于事。

FROM php:7.3.4-apache

# Install v8js
RUN apt-get update && apt-get install -y libv8-3.14.5
RUN pecl install v8js-2.1.0 && docker-php-ext-enable v8js

# Install xdebug.
RUN pecl install xdebug-2.7.1 && docker-php-ext-enable xdebug

# Turn on mod_rewrite module for Apache.
RUN a2enmod rewrite

# Restart Apache.
RUN service apache2 restart

# Use the default development configuration.
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

尝试从上述Dockerfile构建映像,libv8-3.14.5软件包安装成功,但是我运行pecl install ...的下一行失败,并显示以下输出:

...
checking for V8 Javascript Engine... yes, shared
checking for V8 files in default path... not found
configure: error: Please reinstall the v8 distribution
ERROR: `/tmp/pear/temp/v8js/configure --with-php-config=/usr/local/bin/php-config --with-v8js' failed
ERROR: Service 'web' failed to build: The command '/bin/sh -c pecl install v8js-2.1.0 && docker-php-ext-enable v8js' returned a non-zero code: 1

使用与您看到的完全相同的命令,即可很好地安装xdebug扩展。

如果对Linux更熟悉的人可以帮助我,我将不胜感激。

0 个答案:

没有答案