標籤:php extensions curl
1、下載php源碼php-7.0.11
# wget http://cn2.php.net/distributions/php-7.0.11.tar.bz2
2、安裝php-devel
# yum install php-devel -y
3、編譯安裝php
# cd php-7.0.11/# ./configure --prefix=/usr/local/php-7.0.11 --disable-debug --enable-shmop --with-gd --with-jpeg-dir=/usr/lib64 --with-png-dir=/usr/lib64 --with-libxml-dir=/usr/lib64 --with-zlib-dir=/usr/lib64 --with-mysqli=mysqlnd --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --enable-sockets --with-iconv--enable-mbstring --enable-mbregex --enable-ftp --enable-gd-native-ttf --enable-fpm --enable-pcntl --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-zip --with-freetype-dir # make# make install
4、編譯安裝curl
4.1 下載c-ares
# wget https://c-ares.haxx.se/download/c-ares-1.10.0.tar.gz
4.2 編譯安裝
# tar xf c-ares-1.10.0.tar.gz# cd c-ares-1.10.0# ./configure --prefix=/usr/local/ c-ares-1.10.0# make# make install
4.3 下載編curl
# wget https://curl.haxx.se/download/curl-7.44.0.tar.bz2
4.4 編譯安裝curl啟用非同步支援c-ares
# tar xf curl-7.44.0.tar.bz2# cd curl-7.44.0# ./configure --prefix=/usr/local/curl-7.44.0# make# make install# cat vim /etc/ld.so.conf.d/curl.conf/usr/local/curl-7.44.0/lib/#ldconfig
5、製作php的curl擴充
# cd php-7.0.11/ext/curl# /usr/local/php-7.0.11/bin/phpize# ./configure --with-php-config=/usr/local/php-7.0.11/bin/php-config --with-curl=/usr/local/curl-7.44.0/# make# make install# ls /usr/local/php-7.0.11/lib/php/extensions/no-debug-non-zts-20151012/curl.so
6、查看AsynchDNS 是否啟用
# /usr/local/php-7.0.11/bin/php -i /etc/php.ini | grep -A 20 curl curlcURL support => enabledcURL Information => 7.44.0Age => 3FeaturesAsynchDNS => YesCharConv => NoDebug => NoGSS-Negotiate => NoIDN => YesIPv6 => Yeskrb4 => NoLargefile => Yeslibz => YesNTLM => YesNTLMWB => YesSPNEGO => NoSSL => YesSSPI => NoTLS-SRP => No
相關連結:
http://www.laruence.com/2014/01/21/2939.html 為什麼要啟用AsynchDNS原因
http://www.haiyun.me/archives/1070.html PHP重新動態編譯Curl擴充添加非同步DNS支援c-ares
本文出自 “馬行空” 部落格,請務必保留此出處http://maxingkong.blog.51cto.com/6184921/1956103
php extensions curl enable AsynchDNS => Yes