On the Internet to download a mock Landing discuz forum PHP Program example, the trial run when the "call to undefined function Curl_init" This error hint, there is no defined function, that is, PHP has not turned on the Curl_init function support. Google has finally solved the following methods:
System environment, WIN2003 iis6,php version 5.2.12
after loading PHP, execute similar $ch = Curl_init (), such statements, there is a call to undefined function curl_init () error prompt.
The workaround is as follows:
1, in the php.ini find Extension=php_curl.dll, remove the front, php.ini generally under C:\Windows.
2, in php.ini find Extension_dir = "ext", remove the front of;, change to Extension_dir = "C:\php5\ext".
"C:\php5\ext" is just an example, that is, the path that the extension points to
3, Php_curl.dll, Libeay32.dll, Ssleay32.dll, Php5ts.dll are handcuffed to the system32 below.
4, and then restart the computer, trouble shooting.
Note: in PHP version 5.2.8, I do not know why, this method can not be resolved, replaced by 5.2.12 to solve.
take the Php+apache under Windows for example.
First, open the php.ini, find the "Extension=php_curl.dll", then remove the front ";" Note, restart Apache.
If this type of problem occurs, first check which directory the PHP.ini extension_dir value is, check for Php_curl.dll in that directory, and download php_ Curl.dll, and then the PHP directory in the Libeay32.dll and Ssleay32.dll to c:\windows\system32 inside, restart apache,ok!
Run PHP under Ubuntu, always prompt call to undefined function curl_init (), reason not to turn: Php5-curl
Curl related content See: Http://packages.ubuntu.com/zh-cn/intrepid/php5-curl
CURL is a library of getting files from FTP, GOPHER, HTTP server.
PHP5 is a html-embedded scripting language. Much of their syntax is borrowed from C, Java and Perl with a couple of the 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 is built with the Suhosin patch.
H1>
(PHP 4 >= 4.0.2)
Curl_init--Initializes a curl session
Describe
int curl_init ([string URL])
The Curl_init () function Initializes a new session and returns a curl handle for use by curl_setopt (), curl_exec (), and the Curl_close () function. If an optional parameter is provided, the CURLOPT_URL option is set to the value of this parameter. You can use the curl_setopt () function to manually set.
Example 1. Initializes a new Curl session and retrieves a Web page
<?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 also: Curl_close (), curl_setopt ()