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