-
Linux软件编译安装都需要依赖两个安装包 gcc gcc-c++ make 可使用yum在线安装
-
# yum -y install gcc gcc-c++ make
- 大部分依赖包这里使用下载的源码进行编译安装,出错的则可以使用网络yum源在线安装,也可以图省事,全都yum在线安装
- 安装yasm
http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
# cd yasm-1.3.0
# ./configure
# make&& make install
- 安装libmcrypt
https://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download
# cd libmcrypt-2.5.8
# ./configure
# make&& make install
- 安装tiff
下载地址: http://download.osgeo.org/libtiff/tiff-4.0.9.tar.gz
# cd tiff-4.0.9
#./configure --prefix=/usr/local/tiff --enable-shared
# make
# make install
- 安装libpng
https://nchc.dl.sourceforge.net/project/libpng/libpng16/1.6.35/libpng-1.6.35.tar.gz
# cd libpng-1.6.35
#./configure --prefix=/usr/local/libpng --enable-shared
# make&& make install
-
安装freetype
http://ring.u-toyama.ac.jp/archives/graphics/freetype/freetype2/freetype-2.7.1.tar.gz
# cd freetype-2.7.1
#./configure --prefix=/usr/local/freetype --enable-shared
# make&& make install
- 安装jpeg
http://www.ijg.org/files/jpegsrc.v9a.tar.gz
# cd jpeg-9a
#./configure --prefix=/usr/local/jpeg --enable-shared
# make&& make install
- 安装libgd
https://github-production-release-asset-2e65be.s3.amazonaws.com/29669711/cb5172f2-8d93-11e7-9615-92822f694ebf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20181003%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20181003T090125Z&X-Amz-Expires=300&X-Amz-Signature=0d2408ac593ecefea66b1ed8435a5cb05ec0743c2bd1369c0c3b88faf8e9fa2d&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dlibgd-2.2.5.tar.gz&response-content-type=application%2Foctet-stream
# cd libgd-2.2.5
#./configure --prefix=/usr/local/libgd --enable-shared --with-jpeg=/usr/local/jpeg --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-fontconfig=/usr/local/freetype --with-xpm=/usr/ --with-tiff=/usr/local/tiff --with-webp=/usr/local/libwebp/
# make&& make install
- 提示警告:unrecognized options: --enable-gd-native-ttf
php7.2是2017年11月底发布的版本,在编译安装时,提示unrecognized options: –with-mcrypt, –enable-gd-native-ttf ,表示php7.2不支持这两个选项,把上面两个编译选项删除就可以了。
- 补充,因为不同的操作系统环境,系统安装开发环境包的完整程度也不相同,由于博主的系统是最小安装(minimal installation),所以需补充yum在线安装一些开发包
- # yum -y install libXpm-devel libvpx t1lib libxslt-devel* libxml2 libxml2-devel bzip2 bzip2-devel libmcrypt libmcrypt-devel openssl openssl-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel readline readline-devel libxslt-devel perl perl-devel psmisc.x86_64 recode recode-devel libtidy libtidy-devel
- # yum -y install php-mbstring (自行选择安装)