Molten
Molten copied to clipboard
如何在docker 中安装?
我尝试安装到docker 中 In file included from /root/Molten-0.1.2beta/molten_chain.h:30:0, from /root/Molten-0.1.2beta/php_molten.h:35, from /root/Molten-0.1.2beta/molten.c:24: /root/Molten-0.1.2beta/php7_wrapper.h: In function 'mo_array_merge': /root/Molten-0.1.2beta/php7_wrapper.h:245:5: warning: implicit declaration of function 'php_array_merge_recursive' [-Wimplicit-function-declaration] php_array_merge_recursive(Z_ARRVAL_P(dest), Z_ARRVAL_P(src)); ^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /root/Molten-0.1.2beta/php_molten.h:36:0, from /root/Molten-0.1.2beta/molten.c:24: /root/Molten-0.1.2beta/molten_intercept.h: At top level: /root/Molten-0.1.2beta/molten_intercept.h:33:43: fatal error: ext/mysqli/php_mysqli_structs.h: No such file or directory #include "ext/mysqli/php_mysqli_structs.h" ^ compilation terminated. 这是错误提示
你这个安装的php 扩展中有mysqli吗?
有得,能否提供各一份可使用dockerfile 文件
为运行 Laravel 编写的 Dockerfile ,装了pdo、zip、phpiredis 和 composer。
另外,#79 有个 pr 参考
FROM php:7.2-fpm-alpine
ENV BUILD_DEPS tzdata \
linux-headers \
libzip-dev \
curl-dev \
git
RUN sed -i -e "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories \
&& apk add --no-cache $BUILD_DEPS \
&& apk add --no-cache --virtual .persistent-deps \
libzip \
#zip \
unzip \
# user & group
&& addgroup -g 3000 -S app \
&& adduser -u 3000 -S -D -G app app \
# build deps
# timezone
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& docker-php-source extract \
# configure zip, including install build_deps
&& docker-php-ext-configure zip --with-libzip \
# phpiredis
&& curl -fsSL 'https://github.com/redis/hiredis/archive/v0.13.3.tar.gz' -o hiredis.tar.gz \
&& mkdir -p hiredis \
&& tar -xf hiredis.tar.gz -C hiredis --strip-components=1 \
&& rm hiredis.tar.gz \
&& ( \
cd hiredis \
&& make -j$(nproc) \
&& make install \
) \
&& rm -r hiredis \
&& curl -fsSL 'https://github.com/nrk/phpiredis/archive/v1.0.0.tar.gz' -o phpiredis.tar.gz \
&& mkdir -p phpiredis \
&& tar -xf phpiredis.tar.gz -C phpiredis --strip-components=1 \
&& rm phpiredis.tar.gz \
&& ( \
cd phpiredis \
&& phpize \
&& ./configure --enable-phpiredis \
&& make -j$(nproc) \
&& make install \
) \
&& rm -r phpiredis \
# molten
&& git clone --depth=1 https://github.com/chuan-yun/Molten.git /usr/src/php/ext/molten \
&& docker-php-ext-configure molten --enable-zipkin-header=yes \
# exts
&& docker-php-ext-install -j$(nproc) zip pdo_mysql molten \
&& docker-php-source delete \
# composer
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php \
&& php -r "unlink('composer-setup.php');" \
&& mv composer.phar /bin/composer \
&& apk del $BUILD_DEPS