dousuo8400 2017-08-14 09:14
浏览 404

Alpine Linux PHP 7 Docker Image安装没有mysqlnd的mysql扩展

I am trying to build a docker image with php 7 based on alpine:3.6. However, one of the requirement is not to use mysqlnd for pdo_mysql and mysqli, which is somehow installed by default if I installed the php through apk add.

Here is the part of Dockerfile which install the php 7 :

RUN echo 'http://dl-cdn.alpinelinux.org/alpine/3.6/main' >> /etc/apk/repositories && \
apk --update add \
    php7 \
    php7-bcmath \
    php7-dom \
    php7-ctype \
    php7-curl \
    php7-fileinfo \
    php7-fpm \
    php7-gd \
    php7-iconv \
    php7-intl \
    php7-json \
    php7-mbstring \
    php7-mcrypt \
php7-mysqli \
php7-opcache \
    php7-openssl \
php7-redis \
    php7-pdo \
    php7-pdo_mysql \
    php7-pdo_pgsql \
    php7-pdo_sqlite \
    php7-phar \
    php7-posix \
    php7-session \
    php7-soap \
    php7-xml \
    php7-xmlreader \
    php7-xmlwriter \
    php7-zip \
    php7-dev \
    php7-pear \
&& apk add --no-cache pcre-dev@latest-stable && \
apk add --no-cache --virtual .mongodb-ext-build-deps openssl-dev && \
pecl install mongodb && \
pecl clear-cache && \
apk del .mongodb-ext-build-deps && \
rm -rf /var/cache/apk/*

When I printed the phpinfo(), mysqli and pdo_mysql will use mysqlnd (which is what I don't want it to be). Any idea how I could work it out?

result of phpinfo on mysqli

result of phpinfo on mysqli

========================================================================== The reason why I don't want to use mysqlnd is because other clients that will fetch the data from this server will crash if the pdo_mysql return native data field. Is there anyway around to make sure the pdo_mysql return string even though mysqlnd is installed?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100