zoukankan      html  css  js  c++  java
  • docker php-fpm中安装GD库

    环境:Centos7.5

    首先进入容器:

    docker exec -it myphp7 /bin/bash
    

    先添加软件源(我在这里浪费了很长时间,先后使用163和aliyun的源都报各种错误,直到使用中科大的源才可以)  

    echo "deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free" > /etc/apt/sources.list 
    >     && echo "deb-src http://mirrors.ustc.edu.cn/debian stable main contrib non-free" >> /etc/apt/sources.list 
    >     && echo "deb http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free" >> /etc/apt/sources.list 
    >     && echo "deb-src http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free" >> /etc/apt/sources.list

    更新

    apt-get update  

    安装必要的支持库

    apt install -y libfreetype6 libwebp-dev libjpeg-dev libpng-dev  

    解压并切换目录

    docker-php-source extract

    cd /usr/src/php/ext

    开始安装

    docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include
    docker-php-ext-install gd

    看到如下提示表示安装成功:

    Libraries have been installed in:
    /usr/src/php/ext/gd/modules  

    重启容器

    docker restart myphp7
    docker ps

    打开浏览器查看phpinfo(),查看GD模块是否已经安装成功。

  • 相关阅读:
    python 可迭代对象与迭代器
    linux与linux远程桌面
    get return value of python in shell
    python反汇编函数字节码
    celery.backends.base.NotRegistered.
    supervisor process management
    Kafka的Log存储解析
    kafka config
    Chanel
    PowerPoint的公式
  • 原文地址:https://www.cnblogs.com/yesok/p/14268728.html
Copyright © 2011-2022 走看看