duanjia4969 2019-04-26 15:49
浏览 286

如何在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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器