我使用readfile()通过我的服务器从Rapidshare的API下载。相关代码如下:
readfile("http://rs$server_id$short_host.rapidshare.com/cgi-bin/rsapi.cgi?sub=download&fileid=$file_id&filename=$file_name&login={$account['username']}&password={$account['password']}");但是当我请求这个页面时,我得到了这个错误:
Warning: readfile(http://rs869l34.rapidshare.com/cgi-bin/rsapi.cgi?sub=download&fileid=3457766962&filename=some_file.rar&login=mylogin&password=mypassword) [function.readfile]: failed to open stream: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? in C:\xampp\htdocs\dl\downloaders\rapidshare_com.php on line 25根据Rapidshare API,没有办法阻止它返回SSL响应。
我需要配置一些特殊的包装器来处理这个问题吗?
谢谢你的帮助!
发布于 2011-05-27 09:15:13
libCurl用于从远程服务器下载文件,如readfile(http://....)。
虽然它可以处理更详细的细节,如cookie,post和ssl证书。有关更多信息,请访问http://cn.php.net/manual/en/book.curl.php
在php.ini中启用curl并尝试以下代码:
$ch=curl_init("http://rs$server_id$short_host.rapidshare.com/cgi-bin/rsapi.cgi?sub=download&fileid=$file_id&filename=$file_name&login={$account['username']}&password={$account['password']}");
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true); // follow http redirect
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,true); //temporary ignore certificate error for easier testing
$data=$curl_exec($ch);https://stackoverflow.com/questions/6146362
复制相似问题