PHP curl_init function Usage _php Tutorial

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

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