huzz  

curl不支持openssl的静态库,所以编译openssl的时候,应该加上shared 参数,记录一下我亲手编译的参数:

./configure --prefix=/usr/local/openssl shared zlib

shared 表示生成动态库

zlib 当然就是zlib了,这个库编译很容易,最好不要自行指定安装位置,因为别的软件安装的时候可能会从你指定的目录里头找不到zlib

接下来就是curl了,高版本的openssl(我用的是openssl-1.0.2e)不再导出V2版本的ssl函数,所以不能用低版本的curl+openssl-1.0.2e,至少curl-7.20.1是不能跟openssl-1.0.2e配合使用,所以我用了curl-7.46.0可以编译通过

export PKG_CONFIG_PATH=/usr/local/openssl/lib/pkgconfig

curl的帮助文档提到,如果系统安装有pkg-config就应该通过配置PKG_CONFIG_PATH让configure程序找到openssl否则curl找不到openssl就很麻烦,这是我踩过的坑,死活找不到openssl,整得我的微信后台都不正常

上参数:

./configure --prefix=/usr/local/libcurl7.46.0 --enable-http --enable-ftp --enable-file --enable-ldap --enable-ldaps --enable-dict --enable-proxy --with-ssl

 

顺便放上php的参数,另php编译oci扩展也比较麻烦,下次上

./configure '--prefix=/usr/local/php' '--enable-fpm' '--enable-mbstring' '--enable-soap' '--enable-bcmath' '--enable-sockets' '--enable-zip' '--with-openssl=/usr/local/openssl' '--with-libxml-dir=/usr/local/libxml2' '--with-curl=/usr/local/libcurl7.46.0' '--with-pcre-dir=/usr/local/pcre' '--with-zlib-dir=/usr/local/zlib' '--with-freetype-dir=/usr/local/freetype2' '--with-png-dir=/usr/local/libpng' '--with-jpeg-dir=/usr/local/jpeg' '--with-gd=/usr/local/libgd' '--with-xpm-dir=/usr/local/libxpm' '--with-mysql' '--with-mysqli'

posted on 2016-09-29 14:21  huzz  阅读(8578)  评论(0编辑  收藏  举报