[英]curl on WAMP server
I am new to webbscrapping and php .How ever i was trying this simple php curl code but output comes out blank. 我是webbscrapping和php的新手,但是我一直在尝试这个简单的php curl代码,但是输出空白。 ie i get a blank webpage when i run the following code
即当我运行以下代码时,我得到一个空白网页
<?
$url = "oooff.com";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$curl_scraped_page = curl_exec($ch);
curl_close($ch);
echo $curl_scraped_page;
?>
I am using Wamp server 2 on a windows 7 64 bit pc. 我在Windows 7 64位PC上使用Wamp服务器2。 i have uncommented php_curl.dll the php.ini files in both apache/bin and php/bin in the wamp .
我没有评论apache / bin和wamp中的php / bin中的php.ini文件php_curl.dll。 I have checked the php_curl extention on the wamp server.
我已经检查了wamp服务器上的php_curl扩展范围。 still i get a blank webpage.
我仍然得到一个空白的网页。 What can be the problem?
可能是什么问题? Any suggestions will be helpful
任何建议都会有帮助
Thanks in advance.. 提前致谢..
A few things you can check: See this link for enabling curl in wamp on windows. 您可以检查以下几件事:请参阅此链接以启用Windows上Wamp的卷曲。
http://www.phpmind.com/blog/2011/02/how-to-enable-curl-in-wamp/ http://www.phpmind.com/blog/2011/02/how-to-enable-curl-in-wamp/
Most likely solution: 最可能的解决方案:
You have to replace the php_curl.dll with the following: This version for windows is compatible with wamp. 您必须用以下内容替换php_curl.dll:Windows的此版本与wamp兼容。 You have to replace it in the PHP extensions tab in wamp server.
您必须在wamp服务器的PHP扩展选项卡中替换它。
Look for Fixed curl extensions and choose your php version. 查找固定的curl扩展名,然后选择您的php版本。 http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
I've got this from another SO Post and this worked for a lot of people. 我从另一个SO Post那里得到了这个,并且对很多人有用。
https://stackoverflow.com/a/13677593/1379394 https://stackoverflow.com/a/13677593/1379394
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.