1 在CentOS上使用PHP的curl访问HTTPS页面时,出现错误“Protocol https not supported or disabled in libcurl”。
表示curl未启用https,需要重新编译php所使用的curl库。
cd curl-7.31.0
./configure --prefix=/home/www/thirdlib/curl --with-ssl=/ueidc/openssl
出现错误提示:
checking for SSL_connect in -lssl... no
checking for ssl with RSAglue/rsaref libs in use... checking for SSL_connect in -lssl... (cached) no
configure: error: OpenSSL libs and/or directories were not found where specified!
是因为安装openssl时没启用shared选项,没有生成共享库
2 问题:
/usr/bin/ld: warning: libcrypto.so.1.0.0, needed by ../lib/.libs/libcurl.so, not found (try using -rpath or -rpath-link)
解决方式:
env LDFLAGS=-R/home/www/thirdlib/openssl/lib ./configure --prefix=/home/www/thirdlib/curl --with-ssl=/home/www/thirdlib/openssl
3 ./configure --with-php-config=/home/www/php/bin/php-config --with-curl=/home/www/thirdlib/curl