Phpcurl_init function usage. Phpcurl_init function usage first, php in Cwindows. in ini, I opened the extensionphp_curl.dll function, and then restarted apapche. The following describes how to capture PHP information in Baidu using the php curl_init function.
First, in php. ini in C \ windows, I opened the extension = php_curl.dll function, and then restarted apapche. The following is what I wrote to capture PHP information in Baidu:
// 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 ");
// Request that CURL return data
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
// Execute the request
$ Result = curl_exec ($ ch) or die (curl_error ());
// Obtain the returned result and display it
Echo $ result;
Echo curl_error ($ ch );
// Disable CURL
Curl_close ($ ch );
?>
But why didn't we respond? No text for the test. if I put echo "test" on the first line, the output will be available. I guess the curl_init () function is not running yet!
Check whether CURL extension support is available in PHP phpinfo!
Copy php_curl.dll to c: \ windows \ and c: \ windows \ system32 and restart apache.
Try again later
This file is not php_curl.dll.
Copy libeay32.dll and ssleay32.dll in the php directory to c: \ windows \ system32 and restart apache.
Http://www.bkjia.com/PHPjc/632492.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/632492.htmlTechArticlephp curl_init function usage first, in C \ windows php. in ini, I opened the extension = php_curl.dll function, and then restarted apapche. The following is the information I wrote to capture PHP in Baidu...