介绍:PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP's ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication. These functions have been added in PHP 4.0.2. 
需求
In order to use the CURL functions you need to install the CURL package. PHP requires that you use CURL 7.0.2-beta or higher. PHP will not work with any version of CURL below version 7.0.2-beta. From PHP version 4.2.3 you will atleast need CURL version 7.9.0 or higher. 例子 1. Using PHP's CURL module to fetch the example.com homepage
<?php$ch = curl_init ("http://www.example.com/");
$fp = fopen ("example_homepage.txt", "w");curl_setopt ($ch, CURLOPT_FILE, $fp);
curl_setopt ($ch, CURLOPT_HEADER, 0);curl_exec ($ch);
curl_close ($ch);
fclose ($fp);
?>

解决方案 »

  1.   

    RedHat Linux 7.3 + Apache1.3.27 + CURL-SSL(rpm包最新)+PHP4.3.2可以做https吗?
    好像不能。
      

  2.   

    用openssl mod_ssl做个https后再试试看
      

  3.   

    curl是一个利用HTTP,HTTPS,FTPGOPHER,DICT, TELNET, LDAP或FILE 来传输文件的客户端程序。
    up,没有用过.
      

  4.   

    curl是一个利用HTTP,HTTPS,FTPGOPHER,DICT, TELNET, LDAP或FILE 来传输文件的客户端程序。
    up,没有用过.
      

  5.   

    看看有没有帮助
    $URL="www.mysite.com/test.php"; 
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL,"https://$URL"); 
      

  6.   

    taogx(滔滔) ,我有用openssl mod_ssl做https 。我这边共有三台机,一台是做了https的,另两台没做,这另两台中有一台能用curl取得https上的数据,而另一台不行,由于当时Linux的安装不是我做的,所以一些细节我不清楚,想问问看,这是什么地方出问题,后来我将CURL卸掉,apache卸掉,PHP卸掉,再重装,还是一样!
    我实在不想重装系统!因服务器不在本地!要是各位大侠都无此经验,那就只好重装系统了!期待着高手的出现!
      

  7.   

    为是我的测试文件:
    <?
    $ch = curl_init();echo "asdfsadsadd$ch<br>";//$test1="http://www.hkever.com/newct/letget.php";$test2="https://www.hkever.com/newct/letget.php"; echo $PostData."<br>";curl_setopt($ch,CURLOPT_URL,$test2);//curl_setopt($ch,CURLOPT_URL,$test1);echo "set postdata OK!<br>";curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);echo " set returntrasfer ok!<br>";curl_setopt($ch, CURLOPT_TIMEOUT,30);echo "set time out ok!<br>";$result=curl_exec($ch);echo "result is :".$result;echo "excute ok!<br>";curl_close($ch);echo "close curl OK!<br>";phpinfo();
    ?>当我用到https的URL时,浏览器就会提示什么DNS错误!