PHP curl_init function usage
First of all, in the c\windows in the php.ini I opened the Extension=php_curl.dll function, and then also restarted the Apapche, the following is my write crawl Baidu php information:
Initialize Curl
$ch = Curl_init () or Die (Curl_error ());
echo "Test";
Set URL parameters
curl_setopt ($ch, Curlopt_url, "http://www.baidu.com/s?wd=php");
Require Curl to return data
curl_setopt ($ch, curlopt_returntransfer,1);
Execute request
$result = curl_exec ($ch) or Die (Curl_error ());
Gets the returned result and displays
echo $result;
echo Curl_error ($ch);
Turn off Curl
Curl_close ($ch);
?>
But why isn't it responding? Not even the text of the test, if I put echo "test", put in the first line can be output, I guess the curl_init () function is not running!
You see PHP phpinfo () with no curl extension support!
Cuff Php_curl.dll to c:\windows\ and C:\Windows\System32 and restart Apache.
Try again later.
Not php_curl.dll this file.
is to copy Libeay32.dll,ssleay32.dll from the PHP directory to C:\Windows\System32 and restart Apache.
http://www.bkjia.com/PHPjc/632492.html www.bkjia.com true http://www.bkjia.com/PHPjc/632492.html techarticle PHP curl_init function usage First, in the c\windows in the php.ini I opened the Extension=php_curl.dll function, and then also restarted the Apapche, the following is my write crawl Baidu php information ...