发布时间:2021/05/11 作者:天马行空 阅读(1480)
1、安装gd库
apt update #更新软件源 apt install -y libwebp-dev libjpeg-dev libpng-dev libfreetype6-dev #安装各种库 docker-php-source extract #解压源码 cd /usr/src/php/ext/gd #gd源码文件夹 docker-php-ext-configure gd --with-webp-dir=/usr/include/webp --with-jpeg-dir=/usr/include --with-png-dir=/usr/include --with-freetype-dir=/usr/include/freetype2 #准备编译 docker-php-ext-install gd #编译安装 php -m | grep gd
2、安装pdo_mysql
docker-php-ext-install pdo_mysql
3、安装bcmath
docker-php-ext-install bcmath
4、安装memcached扩展
1)先安装依赖
wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz tar -zvxf libmemcached-1.0.18.tar.gz cd libmemcached-1.0.18 ./configure --prefix=/usr/local/libmemcached --with-memcached
注意安装libmemcached时会出现报错,需要更改源代码中clients/memflush.cc的42和51行为if (!opt_servers)即可解决
2)安装memcached
wget http://pecl.php.net/get/memcached-3.1.5.tgz tar -zvxf memcached-3.1.5.tgz cp -r memcached-3.1.5 /usr/src/php/ext/memcached docker-php-ext-configure memcached --with-libmemcached-dir=/usr/local/libmemcached --disable-memcached-sasl docker-php-ext-install memcached
5、安装redis
wget http://pecl.php.net/get/redis-5.3.4.tgz tar -zvxf redis-5.3.4.tgz cp -r redis-5.3.4 /usr/src/php/ext/redis docker-php-ext-install redis