Page 1 of 1

CURL Extension won't WORK! help!

Posted: Wed Apr 05, 2006 3:44 pm
by thym
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello,

I have:

Code: Select all

<?php
// create a new CURL resource
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://www.google.com/");
curl_setopt($ch, CURLOPT_HEADER, false);

// grab URL and pass it to the browser
curl_exec($ch);

// close CURL resource, and free up system resources
curl_close($ch);
?>
And i always get a blank page without source! What I need to do?. I use EasyPHP and php_curl extension is activate!
Thank you so much!


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Apr 05, 2006 3:56 pm
by feyd
Run the following in a new file and tell us the results please.

Code: Select all

<?php

$ve = phpversion();
$os = PHP_OS;
$er = intval(error_reporting());
$rg = (in_array(strtolower(ini_get('register_globals')), array(0, false, '', null, 'off')) ? 'Off' : 'On');
$de = (in_array(strtolower(ini_get('display_errors')), array(0, false, '', null, 'off')) ? 'Off' : 'On');
$so = (in_array(strtolower(ini_get('short_open_tag')), array(0, false, '', null, 'off')) ? 'Off' : 'On');
$eol = (isset($_SERVER['HTTP_HOST']) ? "<br />\n" : "\n");

$ec = array(
   'E_STRICT' => 2048,
   'E_ALL' => 2047,
   'E_USER_NOTICE' => 1024,
   'E_USER_WARNING' => 512,
   'E_USER_ERROR' => 256,
   'E_COMPILE_WARNING' => 128,
   'E_COMPILE_ERROR' => 64,
   'E_CORE_WARNING' => 32,
   'E_CORE_ERROR' => 16,
   'E_NOTICE' => 8,
   'E_PARSE' => 4,
   'E_WARNING' => 2,
   'E_ERROR' => 1,
);

$e = array();
$t = $er;
foreach ($ec as $n => $v)
{
   if (($t & $v) == $v)
   {
      $e[] = $n;
      $t ^= $v;
   }
}
$er = $er . ' (' . implode(' | ', $e) . ')';

echo 'PHP Version: ' . $ve . $eol;
echo 'PHP OS: ' . $os . $eol;
echo 'Error Reporting: ' . $er . $eol;
echo 'Register Globals: ' . $rg . $eol;
echo 'Short Tags: ' . $so . $eol;
echo 'Display Errors: ' . $de . $eol;

?>

Posted: Thu Apr 06, 2006 7:04 am
by thym
PHP Version: 4.3.10
PHP OS: WINNT
Error Reporting: 2047 (E_ALL)
Register Globals: Off
Short Tags: On
Display Errors: On

Posted: Thu Apr 06, 2006 7:22 am
by BDKR
Seeing as how you are using the provided example from the PHP site, did you also try reading the comments below?