1

I am new to webbscrapping and php .How ever i was trying this simple php curl code but output comes out blank. i.e 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. i have uncommented php_curl.dll the php.ini files in both apache/bin and php/bin in the wamp . I have checked the php_curl extention on the wamp server. still i get a blank webpage. What can be the problem? Any suggestions will be helpful

Thanks in advance..

Navya
  • 13
  • 3

1 Answers1

0

A few things you can check: See this link for enabling curl in wamp on windows.

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. You have to replace it in the PHP extensions tab in wamp server.

Look for Fixed curl extensions and choose your php version. 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.

https://stackoverflow.com/a/13677593/1379394

Community
  • 1
  • 1
Kees Sonnema
  • 5,759
  • 6
  • 51
  • 106
  • i did this and i got fatal error:Call to undefined function curl_init() in C:\wamp\www\scrappingphpcurl.php on line 3 – Navya May 29 '13 at 10:23
  • Finally!! i just used addon apache version 2.2.9 and php 5.3.1 and voila it worked!!!! – Navya May 29 '13 at 10:58
  • Actually Kees, if he installed the new addons to get it working your answer did not solve his question! – RiggsFolly May 30 '13 at 19:48
  • I know. But he asked for a solution, and the problem is solved. When he occures a new problem. He can ask a new question any time :) – Kees Sonnema May 31 '13 at 06:40