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

I am building a custom Docker image from the official php-apache image but am failing to install the v8js PECL extension.

I've tried running the same commands I have used to install other PECL extensions, such as xdebug, but had no luck -- the build fails saying that I need to install the v8 distribution. I did try doing so using some Linux commands I googled around for, but I am not familiar with Linux at all, so really have no idea how to do this myself. Unfortunately the convenience scripts provided by the php-apache devs don't help in this case.

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"

Trying to build an image from the above Dockerfile, the libv8-3.14.5 package installs successfully, but the next line where I run pecl install... fails with the following output:

...
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

The xdebug extensions installs just fine, using the exact same command as you can see.

If anyone more familiar with Linux could help me out I'd appreciate the help.

douqiang5163
douqiang5163 这可能有帮助,可能是github.com/talyssonoc/react-laravel/issues/10
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐