I downloaded a php program example simulating login to the discuz forum on the Internet. During the trial run, the error "Call to undefined function curl_init" is prompted, and no function is defined, that is, php does not support the curl_init function. Google finally solved the problem as follows:
Take php + apache in windows as an example.
First, open php. ini, find "extension = php_curl.dll", remove the comment ";", and restart apache.
If such problems still occur, first check php. which directory is the extension_dir value of ini? Check for php_curl.dll in that directory. If not, download php_curl.dll and copy libeay32.dll and ssleay32.dll in the php Directory to c: \ windows \ system32, restart apache. OK!
Running php In Ubuntu always prompts Call to undefined function curl_init () for no reason: php5-curl
For content related to curl, see: http://packages.ubuntu.com/zh-cn/intrepid/php5-curl
CURL is a library for getting files from FTP, GOPHER, HTTP server.
PHP5 is an HTML-embedded scripting language. much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. the goal of the language is to allow web developers to write dinamically generated pages quickly. this version of PHP5 was built with the Suhosin patch.
H1>
(PHP 4> = 4.0.2)
Curl_init -- initialize a CURL session
Description
Int curl_init ([string url])
The curl_init () function initializes a new session and returns a CURL handle for use by the curl_setopt (), curl_exec (), and curl_close () functions. If the optional parameter is provided, the CURLOPT_URL option is set to the value of this parameter. You can use the curl_setopt () function for manual settings.
Example 1. initialize a new CURL session and retrieve a webpage
<? Php
$ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, "http://www.zend.com /");
Curl_setopt ($ ch, CURLOPT_HEADER, 0 );
Curl_exec ($ ch );
Curl_close ($ ch );
?>
See: curl_close (), curl_setopt ()