在安装SuiteCRM的过程中遇到了 没有zip扩展功能的问题,经过一番折腾,找到了这个文章,在此转发分享,希望对其他人有所帮助。
1.先进入myphp容器,看一下php目前安装了哪些扩展:
$ docker exec -it myphp /bin/bash
root@myphp:/# php -m
[PHP Modules]
Core 、ctype、curl、date、dom、fileinfo、filter、ftp、hash、iconv、json、libxml、mbstring、mysqli、mysqlnd、openssl、pcre、PDO、pdo_mysql、pdo_sqlite、Phar、posix、readline、Reflection、session、SimpleXML、sodium、SPL、sqlite3、standard、tokenizer、xml、xmlreader、xmlwriter、zip、zlib
2.其他扩展的安装:
2.1.先更新一下系统
root@myphp:/# apt-get update
2.2进入 /usr/local/bin 看一下安装和配置工具
root@myphp:/# cd /usr/local/bin
root@myphp:/usr/local/bin# ls
docker-php-entrypoint docker-php-ext-enable docker-php-source peardev phar php phpdbg
docker-php-ext-configure docker-php-ext-install pear pecl phar.phar php-config phpize
2.3 官方的各个扩展的安装
bcmath, calendar, exif, gettext, sockets, dba,mysqli, pcntl, pdo_mysql, shmop, sysvmsg, sysvsem, sysvshm
docker-php-ext-install -j$(nproc) bcmath calendar exif gettext sockets dba mysqli pcntl pdo_mysql shmop sysvmsg sysvsem sysvshm
2.4 其他的安装
bz2 扩展的安装, 读写 bzip2(.bz2)压缩文件
$ 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
enchant 扩展的安装, 拼写检查库
$ 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
gd 扩展的安装. 图像处理
$ 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
gmp 扩展的安装, GMP
$ 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
soap wddx xmlrpc tidy xsl 扩展的安装
$ 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
zip 扩展的安装
$ 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
snmp 扩展的安装
$ 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
pgsql, pdo_pgsql 扩展的安装
$ 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
pspell 扩展的安装
$ 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
recode 扩展的安装
$ 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
pdo_firebird 扩展的安装
$ 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
pdo_dblib 扩展的安装
$ 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
ldap 扩展的安装
$ 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
imap 扩展的安装
$ 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
interbase 扩展的安装
$ 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
intl 扩展的安装
$ 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
mcrypt 扩展的安装
$ 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
imagick 扩展的安装
$ 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
memcached 扩展的安装
$ 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
redis 扩展的安装
$ pecl install redis-4.0.1 && docker-php-ext-enable redis
opcache 扩展的安装
$ docker-php-ext-configure opcache --enable-opcache && docker-php-ext-install opcache
转自 26点的博客
链接:http://www.iamlintao.com/6711.html