docker安装PHP扩展2020-05-25

示例:

1、docker-php-ext-install pdo_mysql

2、extension=php_pdo_mysql.dll

一、docker按照PHP扩展

先删除原来的composer容器,重新执行以下命令:
docker run -it --name composer -v E:\docker\nginx\www\YYXTServer:/app --privileged=true composer <执行命令composer require php-amqplib/php-amqplib>

二、docker按照php的gd扩展


#容器中

#软件源修改为网易镜像站源在安装过程中会报错,要更改为以下源:

#echo "deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free

deb-src http://mirrors.ustc.edu.cn/debian stable main contrib non-free

deb http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free

deb-src http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free

" > /etc/apt/sources.list

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容