Windows 7 (X64) system environment PHPCurl functions cannot be used _ PHP Tutorial

Source: Internet
Author: User
The PHPCurl function in Windows 7 (X64) is unavailable. The Curl function is not enabled by default in php. if you need to use Curl, remove the extension php_curl.dll in php. ini. First, I put php. ext Curl function in ini is a default component in php. if you need to use Curl, we need. in ini, remove the extension = php_curl.dll.

I first removed the extension = php_curl.dll in php. ini and restarted the apache environment, but the following function is prompted when I call the following function:

The code is as follows:

// Initialize a cURL object
$ Curl = curl_init ();
// Set the URL you want to capture
Curl_setopt ($ curl, CURLOPT_URL, 'http: // www. bKjia. c0m '');
// Set the header
Curl_setopt ($ curl, CURLOPT_HEADER, 1 );
// Set the cURL parameter. The result must be saved to the string or output to the screen.
Curl_setopt ($ curl, CURLOPT_RETURNTRANSFER, 1 );
// Run cURL to request the webpage
$ Data = curl_exec ($ curl );
// Close the URL request
Curl_close ($ curl );
// Display the obtained data
Var_dump ($ data );
?>

Error message

Call to undefined function curl_init ()

After reading the relevant articles, I copied three files under the ext directory of PHP: php_curl.dll, libeay32.dll, and ssleay32.dll to the system32 directory of the system, then google found that Windows 7 (x64) has a difference that the built-in php_curl.dll file does not work in a 64-bit Windows 7 environment.

Specific steps:

1. click the wamp icon in the notification bar, find the php_curl option in php-ext, and click Select. wait until the wamp service is restarted.

2. download the repaired php_curl.dll (php5.X/X64 system) file and place it in the wampbinphpphp (version) ext folder.

3. restart the wamp service.

Prompt

After so long, it turns out that the php environment we installed is different from the system version. we 'd better select the number of php versions for the number of systems.

Bytes. I first put ext... in php. ini...

Related Article

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.