1
votes

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..

1
Please check in phpinfo() curl is enabled or not ? - Praveen kalal
Do you get any errors in your log? Try to use var_dump on $curl_scraped_page instead of echo. - h2ooooooo
Have you restarted your apache/wamp? - Kees Sonnema
check your curl_info() - ianace
@Praveenkalal I ve chked in phpinfo().curl is enabled there - Navya

1 Answers

0
votes

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