Home > Article > Backend Development > Discussion on the problem of curl opening in PHP_PHP tutorial
Today I am working on a Sina login function. The curl_init() function needs to be used in the PHP SDK provided by Sina. When debugging, it is reported that the curl_init() method cannot be found.
After searching, I learned that I need to enable the php extension of curl. So what is curl? What can be done?
A brief introduction, when we need to capture the data information of a website, we can use file(), file_get_contents() and other web page reading functions. Due to the proliferation of too many thief programs, some sites have implemented domain name restrictions. , thus making these file() functions inefficient or even invalid.
If you use curl to optimize it, you can achieve powerful and flexible functions such as forms, cookies, and verification.
Steps to open curl
1. Output phpinfo under the localhost site to detect the location of php.ini
(Because when I open CURL, it is in php I configured php.ini in the installation directory, but the result never took effect. After checking phpinfo, I found out that php.ini was redirected by me in the configuration file of apache
)
2. Open the php.ini file and search for php_curl .dll, delete the preceding ";" after finding it, and restart apache
3. If the test still cannot find curl_init(), change php_curl.dll in the ext directory under the php directory, and libeay32 under the php directory. dll, php5ts.dll, ssleay32.dll
Copy to c:windowssystem32, restart apache
Verify whether the curl extension is turned on, you can search it in phpinfo()
You can also use the program to verify