[php] 2024-11-14 圈点761
摘要:php5.2编译的curl支持https,默认情况下php5.2编译出来的curl总是不支持curl的https,仅支持http;
php5.2编译的curl支持https
默认情况下php5.2编译出来的curl总是不支持curl的https,仅支持http;
原来是curl包不对;需要安装另外一个curl并在编译php的时候指定curl新安装的地址;
步骤如下:
1,下载curl版本:wget http://curl.haxx.se/download/curl-7.44.0.tar.gz
2,tar -zxvf curl-7.44.0.tar.gz
3,cd curl-7.44.0.tar.gz
4,./configurl --prefix=/usr/local/curl --with-gssapi --enable-tls-srp --with-libmetalink
5,make && make install
6,重新编译php
注意php的配置参数
--with-curl=/usr/local/curl
添加指定的路径
7,make && makeinstall
示例:原来的php配置参数
./configure --prefix=/usr/local/php --enable-fastcgi --enable-zip --enable-fpm --enable-gd-native-ttf --with-config-file-path=/usr/local/php/etc --with-config-file-scan-dir=/usr/local/php/etc/php.d --with-bz2 --with-curl --with-libxml-dir --with-gd --with-jpeg-dir --with-freetype-dir --with-png-dir --with-mcrypt --with-mhash --enable-mbstring --with-kerberos --with-gettext --enable-bcmath --with-mysql --with-mysqli --with-sqlite --enable-pdo --with-pdo-mysql --with-openssl --enable-ftp --with-pear --with-zlib --enable-inline-optimization --enable-calendar --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --disable-debug
实际的PHP配置参数,可以按实际情况需要
./configure --prefix=/usr/local/php --enable-fastcgi --enable-zip --enable-fpm --enable-gd-native-ttf --with-config-file-path=/usr/local/php/etc --with-bz2 --with-curl=/usr/local/curl --with-libxml-dir --with-gd --with-jpeg-dir --with-freetype-dir --with-png-dir --with-mcrypt --with-mhash --enable-mbstring --with-mysql --with-mysqli --with-sqlite --enable-pdo --with-pdo-mysql --with-openssl --with-zlib --enable-magic-quotes --disable-debug