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、百度
去.....編譯