Phpcurl_init function usage _ PHP Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.