记录下爬坑过程,以便以后使用
原料:
Ubuntu16.04 Server
PHP5.6.30
步骤:
手动编译源码之前需要提前安装编译环境,以下为所需要的安装包:
apt-get -y install gcc libxml2-dev libssl-dev libbz2-dev libcurl4-openssl-dev libgdchart-gd2-noxpm-dev libgmp-dev libmcrypt-dev libreadline-dev libxslt-dev make
其中有两个坑:
Openssl库文件安装后不存在:
ln -s /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib
Gmp库文件安装后不存在:
ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include
这样个都是因为x86与x64所安装时库文件位置不一致所导致
预编译对应的一些依赖包:
./configure --prefix=/usr/local/PHP --with-fpm-user=Nginx --with-config-file-path=/usr/local/PHP/etc/ --with-fpm-group=Nginx --with-MysqL=MysqLnd --with-MysqLi=MysqLnd --with-pdo-MysqL=MysqLnd --enable-fpm --enable-soap --with-xmlrpc --with-openssl --with-mcrypt --with-pcre-regex --with-sqlite3 --with-zlib --with-iconv --with-bz2 --enable-calendar --with-curl --enable-dba --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter --with-pcre-dir --enable-ftp --with-gd --with-openssl-dir --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring --disable-mbregex-backtrack --with-libmbfl --with-onig --enable-pdo --with-zlib-dir --with-pdo-sqlite --with-pdo-MysqL --with-readline --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-libxml-dir --with-xsl --enable-zip --enable-MysqLnd-compression-support --with-pear --enable-opcache --enable-inline-optimization --enable-bcmath
编译安装:
make && make install