在php程序中使用curl去访问https站点时,报错:
Protocol https not supported or disabled in libcurl

该错误信息表示php当时编译时使用的curl库不支持https, 验证方法为
你的curl安装目录/bin/curl  -V  
显示如下:
Protocols: dict file ftp gopher http imap pop3 rtsp smtp telnet tftp
这表示curl是不支持 https的

为了支持https,需要下载源码包,重新编译curl

tar zxvf curl-7.24.0.tar.gz
cd  curl-7.24.0
./configure --prefix=/usr/local/services/curl-7.24.0 --with-ssl=/usr/local/services/openssl-0.9.8a
#请注意,这里一定要使用 --with-ssl 参数,前提是你已经安装了openssl-0.9.8a (建议安装0.9.8a 测试过0.9.7i有些bug)
该步骤执行结束后,一定要观察仔细,是否有这行
  SSL support:     enabled (OpenSSL)
如果你的是
  SSL support:     no 
那就是说,你的curl依旧没有支持https

make  &&  make install 
在make的时候,也许你会遇到这样的错误:
`a local symbol' can not be used when making a shared object; recompile with -fPIC
libssl.a: could not read symbols: Bad value
解决办法,请参考http://mylinux.5d6d.net/viewthread.php?tid=1013
安装完成后,再次运行
curl安装目录/bin/curl -V
结果为
Protocols: dict file ftp gopher http https imap pop3 rtsp smtp telnet tftp
这说明已经支持了https

剩下的就是重新编译php, 当然相应的支持curl的参数为  --with-curl=你的curl安装目录

最新文章

  1. crm2011 使用SOAP 查询单个记录 Retrieve
  2. (七)HTTP协议
  3. .htaccess根据IP地址限制访问
  4. iOS-----类和对象,nil/Nil/NULL的区别
  5. SAP 禁止某个库位的货物移动
  6. javascript中的this应用
  7. C#DataGridView 美化
  8. linux kernel 模块多文件编译
  9. SharePoint移动客户端--Rshare 中的Smart Cache
  10. 网络断开后重连downloadProvider继续下载问题调试分析
  11. css案例学习之继承关系
  12. spring Bean类自动装载实现
  13. PHP 【三】
  14. AVAudioSesion和AVAudioPlayer的基本使用
  15. 既然写CSS很容易,那为什么大家还是把CSS写的那么烂呢?
  16. SAS对数据变量的处理
  17. CF115B Lawnmower(贪心)
  18. flask + apidoc 生成接口文档(附加一个坑)
  19. OpenCV中图像算术操作与逻辑操作
  20. (转)st(state-threads) coroutine和stack分析

热门文章

  1. RequireJS进阶(一) 转
  2. SQL Server数据类型与SDE库表sde_type对照表
  3. check windows return character
  4. Win7+xp命令行 一键修改IP、DNS
  5. bzoj1193
  6. python的使用环境总结
  7. 将dataset写入数据库
  8. 深刻理解Python中的元类metaclass(转)
  9. pd虚拟机死机怎么解决
  10. delphi 集合