libpng-dev libjpeg-dev libxpm-dev
sudo apt-get install libpng-dev sudo apt-get install libjpeg-dev sudo apt-get install libxpm-dev
而后:php
--with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-xpm-dir=/usr/lib
具体怎么找来的,可使用 sudo find /usr -iname '*libpng*'
命令查找字体
// 这边无需装 freetype 1.x (反正我是安装失败了....) freetype 2.x
官网下载code
tar -zxvf freetype-2.8.tar.gz cd freetype-2.8 sudo ./configure sudo make sudo make install
而后,--with-freetype-dir=/usr/local/include/freetype2
,具体查找同上。get
cd php-7.1.8/ext/gd sudo phpize sudo ./configure \ --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-xpm-dir=/usr/lib --with-freetype-dir=/usr/local/include/freetype2 sudo make sudo make install
若是提示 freetype-config
未找到,那么能够尝试下从新安装 freetype2
或者执行 sudo apt-get install libfreetype6-dev
it
本身 Google、百度
去.....编译