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 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题