1.安装依赖库。
yum install libjpeg* libpng* freetype*
.......
2.进入php根目录,编译
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysqli --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql --enable-fpm --enable-mbstring --enable-ftp --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-png-dir --with-freetype-dir --with-zlib-dir --with-gd
make
make install