php 用curl作采集服务时,返回的数据为空,throw new Exception(curl_error($this->_curl), curl_errno($this->_curl)); 抛出异常信息后显示 curl connect error,
经phpinfo比对后发现 可用的服务器 curl 是openssl ,不可用的curl 是nss
也可以使用curl -V命令来查看,发现里面是nss
所以需要把curl重新加入openssl编译
编译方法如下:
先去官方下载 http://curl.haxx.se/download/archeology/
./configure --prefix=/usr --without-nss --with-ssl
make && make install
ldconfig #重新载入配置文件的命令
curl -V
这样里面就会显示 openssl
重新启动php和apache服务后生效