记录下爬坑过程,以便以后使用


原料:

  1. Ubuntu16.04 Server

  2. PHP5.6.30


步骤:

  1. 手动编译源码之前需要提前安装编译环境,以下为所需要的安装包:

    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

  2. 其中有两个坑:

    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所安装时库文件位置不一致所导致

  3. 预编译对应的一些依赖包:

    ./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

  4. 编译安装:

    make && make install