您好,登錄后才能下訂單哦!
本篇內容主要講解“Docker怎么用PHP擴展配置”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“Docker怎么用PHP擴展配置”吧!
# PHP 容器配置 # 從官方基礎版本構建 FROM php:7.2-fpm # 官方版本默認安裝擴展: # Core, ctype, curl # date, dom # fileinfo, filter, ftp # hash # iconv # json # libxml # mbstring, mysqlnd # openssl # pcre, PDO, pdo_sqlite, Phar, posix # readline, Reflection, session, SimpleXML, sodium, SPL, sqlite3, standard # tokenizer # xml, xmlreader, xmlwriter # zlib # 1.0.2 增加 bcmath, calendar, exif, gettext, sockets, dba, # mysqli, pcntl, pdo_mysql, shmop, sysvmsg, sysvsem, sysvshm 擴展 RUN docker-php-ext-install -j$(nproc) bcmath calendar exif gettext \ sockets dba mysqli pcntl pdo_mysql shmop sysvmsg sysvsem sysvshm # 1.0.3 增加 bz2 擴展, 讀寫 bzip2(.bz2)壓縮文件 RUN apt-get update && \ apt-get install -y --no-install-recommends libbz2-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-install -j$(nproc) bz2 # 1.0.4 增加 enchant 擴展, 拼寫檢查庫 RUN apt-get update && \ apt-get install -y --no-install-recommends libenchant-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-install -j$(nproc) enchant # 1.0.5 增加 GD 擴展. 圖像處理 RUN apt-get update && \ apt-get install -y --no-install-recommends libfreetype6-dev libjpeg62-turbo-dev libpng-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \ docker-php-ext-install -j$(nproc) gd # 1.0.6 增加 gmp 擴展, GMP RUN apt-get update && \ apt-get install -y --no-install-recommends libgmp-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-install -j$(nproc) gmp # 1.0.7 增加 soap wddx xmlrpc tidy xsl 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends libxml2-dev libtidy-dev libxslt1-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-install -j$(nproc) soap wddx xmlrpc tidy xsl # 1.0.8 增加 zip 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends libzip-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-install -j$(nproc) zip # 1.0.9 增加 snmp 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends libsnmp-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-install -j$(nproc) snmp # 1.0.10 增加 pgsql, pdo_pgsql 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends libpq-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-install -j$(nproc) pgsql pdo_pgsql # 1.0.11 增加 pspell 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends libpspell-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-install -j$(nproc) pspell # 1.0.12 增加 recode 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends librecode-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-install -j$(nproc) recode # 1.0.13 增加 PDO_Firebird 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends firebird-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-install -j$(nproc) pdo_firebird # 1.0.14 增加 pdo_dblib 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends freetds-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-configure pdo_dblib --with-libdir=lib/x86_64-linux-gnu && \ docker-php-ext-install -j$(nproc) pdo_dblib # 1.0.15 增加 ldap 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends libldap2-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu && \ docker-php-ext-install -j$(nproc) ldap # 1.0.16 增加 imap 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends libc-client-dev libkrb5-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \ docker-php-ext-install -j$(nproc) imap # 1.0.17 增加 interbase 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends firebird-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-install -j$(nproc) interbase # 1.0.18 增加 intl 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends libicu-dev && \ rm -r /var/lib/apt/lists/* && \ docker-php-ext-install -j$(nproc) intl # 1.0.19 增加 mcrypt 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends libmcrypt-dev && \ rm -r /var/lib/apt/lists/* && \ pecl install mcrypt-1.0.1 && \ docker-php-ext-enable mcrypt # 1.0.20 imagick 擴展 RUN export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" && \ apt-get update && \ apt-get install -y --no-install-recommends libmagickwand-dev && \ rm -rf /var/lib/apt/lists/* && \ pecl install imagick-3.4.3 && \ docker-php-ext-enable imagick # 1.0.21 增加 Memcached 擴展 RUN apt-get update && \ apt-get install -y --no-install-recommends zlib1g-dev libmemcached-dev && \ rm -r /var/lib/apt/lists/* && \ pecl install memcached && \ docker-php-ext-enable memcached # 1.0.22 redis 擴展 RUN pecl install redis-4.0.1 && docker-php-ext-enable redis # 1.0.23 增加 opcache 擴展 RUN docker-php-ext-configure opcache --enable-opcache && docker-php-ext-install opcache # 1.0.24 增加 odbc, pdo_odbc 擴展 RUN set -ex; \ docker-php-source extract; \ { \ echo '# https://github.com/docker-library/php/issues/103#issuecomment-271413933'; \ echo 'AC_DEFUN([PHP_ALWAYS_SHARED],[])dnl'; \ echo; \ cat /usr/src/php/ext/odbc/config.m4; \ } > temp.m4; \ mv temp.m4 /usr/src/php/ext/odbc/config.m4; \ apt-get update; \ apt-get install -y --no-install-recommends unixodbc-dev; \ rm -rf /var/lib/apt/lists/*; \ docker-php-ext-configure odbc --with-unixODBC=shared,/usr; \ docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr; \ docker-php-ext-install odbc pdo_odbc; \ docker-php-source delete # 鏡像信息 LABEL Author="Leo" LABEL Version="1.0.25-fpm" LABEL Description="PHP FPM 7.2 鏡像. All extensions."
到此,相信大家對“Docker怎么用PHP擴展配置”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。