Sina provided in the PHP SDK needs to use the Curl_init () function, in the debugging time to find the Curl_init (), the following for you to open the curl steps
Today in doing a Sina login function, Sina provides the PHP SDK needs to use the Curl_init () function, in the debugging time can not find the Curl_init () method. Search to find the need to open curl PHP expansion, then what is curl? What can I do? Brief Introduction, when we need to grasp the data of a website, you can use the file (), file_get_contents (), such as Web page reading function, because too much of the thief program flooded, causing some sites to do the domain name restrictions, Instead, these file () functions are inefficient or even ineffective. If the use of curl to optimize the words can be a number of forms, cookies, validation and other functions of the powerful, flexible effect. Open Curl steps 1. At the localhost site, export the Phpinfo to detect PHP.ini's location in (because when I open the curl, is in the PHP installation directory configuration php.ini, the result has not been effective, and later checked phpinfo just know php.ini in apache configuration file was I redirected) 2. Open php.ini file and search Php_ Curl.dll, locate and remove the front ";", reboot apache 3. If the test is still unable to find Curl_init (), the PHP directory in the ext directory of PHP_ Curl.dll, and the PHP directory under the libeay32.dll,php5ts.dll,ssleay32.dll copy to C:windowssystem32, reboot apache Verify that the curl extension is open, Can be found in phpinfo () can also use program validation code as follows://1. Initialization $ch = Curl_init (); //2. Set options, including url curl_setopt ($ch, Curlopt_url, "http://www.tupc1028.com"); curl_setopt ($ch, Curlopt_ Returntransfer, 1); curl_setopt ($ch, Curlopt_header, 0); //3. Executes and obtains HTML document content $output = curl_exec ($ch); &nBsp 4. Release Curl handle curl_close ($ch); $output = curl_exec ($ch); if ($output = = FALSE) { echo "Curl Error:". Curl_error ($ch); }