Home >Backend Development >PHP Tutorial >A simple method to enable curl in PHP (test feasible) original, curlfont_PHP tutorial
This article describes a simple method to open curl in PHP. Share it with everyone for your reference, the details are as follows:
1. Question:
The error message "Call to undefined function curl_init" appears on the windows host. There is no defined function, that is, PHP has not yet opened support for the curl_init function.
2. Solution:
You need to enable the curl function library of PHP. The specific steps are as follows:
① Open php.ini (usually in the C:Windows directory, WampServer is usually in a directory similar to C:wampbinphpphp5.3.8) and find Copy the code The code is as follows:;extension=php_curl.dll remove the preceding semicolon ";"
② Check which directory the extension_dir value of php.ini is, and check whether there is php_curl.dll in the directory. If not, please download php_curl.dll
③ Then copy libeay32.dll and ssleay32.dll in the php directory to c:windowssystem32
④ Just restart apache or iis.
Use the phpinfo() function to view the configuration information. You can see that curl is enabled:
Readers who are interested in more content related to php curl can check out the special topic of this site: "Summary of php curl usage"
I hope this article will be helpful to everyone in PHP programming.