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 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了
    • ¥50 切换TabTip键盘的输入法
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据