I'm going to use the Curl function to collect data when I find that the call to undefined function Curl_init error, later learned from the official website because curl default is not PHP open function, we need to manually open Oh, Let me show you how to turn on the Curl function.
Cases
The code is as follows |
Copy Code |
$ch = Curl_init (); Initialize Curl curl_setopt ($ch, Curlopt_url, $url);//Set link curl_setopt ($ch, Curlopt_returntransfer, 1);//Set whether to return information curl_setopt ($ch, Curlopt_httpheader, $header);//Set HTTP header curl_setopt ($ch, Curlopt_post, 1);//set to POST mode curl_setopt ($ch, Curlopt_postfields, $xml _data);//post data $response = curl_exec ($ch);//Receive return information if (Curl_errno ($ch)) {//error message displayed Print Curl_error ($ch); } Curl_close ($ch); Turn off Curl Links echo $response;//Display return information |
Results appear
Call to undefined function curl_init
Here's how to fix it:
1. Open the php.ini and turn on the Extension=php_curl.dll
2. Check php.ini extension_dir value is which directory, check if there is no php_curl.dll, do not download Php_curl.dll, and then copy the PHP directory Libeay32.dll,ssleay32.dll to C: Windowssystem32 inside
There's still a problem after the change.
In the httpd.conf file, add:
LoadFile the full path of the dynamic link library
For example, PHP needs to extend curl here, so the workaround is to add the following in the httpd.conf file:
LoadFile D:/php/libeay32.dll
LoadFile D:/php/ssleay32.dll
That will solve the problem.
http://www.bkjia.com/PHPjc/632116.html www.bkjia.com true http://www.bkjia.com/PHPjc/632116.html techarticle I'm going to use the Curl function to collect data when I find that the call to undefined function Curl_init error, later learned from the official website because curl default is not PHP open function, we need to hand ...