PHP runs the solution Call to undefined function curl_init of

  • 2020-03-31 21:19:12
  • OfStack

System environment, WIN2003 is 6, PHP version 5.2.12
After installing PHP, execute something like $ch = curl_init(). The Call to undefined function curl_init() error appears.

The solution is as follows:

1. Find extension= php_curd. DLL in php.ini. Without the previous one, php.ini is usually under c:\ Windows.

2. Find extension_dir = "ext" in php.ini. , extension_dir = "C:\php5\ext".
"C:\php5\ext" is just an example that the extension points to the right path

3. Php_curl. DLL, libeay32.dll, ssleay32.dll, php5ts.

4. Then restart the computer and troubleshoot.

Note: in version 5.2.8 of PHP, I don't know why, but I can't solve it with this method.

Take PHP +apache under Windows as an example.

First, open php.ini, find "extension=php_curl. DLL" and remove the ";" Comment, just restart apache.

If there are still such problems, first check which directory is the value of php.ini extension_dir, in that directory to check whether there is php_curl. If not, please download php_curl.

Running PHP under Ubuntu always prompts Call to undefined function curl_init() for no reason: php5-curl

The 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 Have the Suhosin patch.

H1 >

(PHP 4 > = 4.0.2)

Curl_init -- initializes a CURL session

describe

Int curl_init ([url string])

The curl_init() function initializes a new session and returns a CURL handle for 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 set this manually using the curl_setopt() function.
Example 1. Initializes a new CURL session and fetches a web page

< The & # 63; PHP
$ch = curl_init ();

Curl_setopt ($ch, CURLOPT_URL, "http://www.zend.com/");
Curl_setopt ($ch, CURLOPT_HEADER, 0);

The curl_exec ($ch);

Curl_close ($ch);
The & # 63; >


See: curl_close(), curl_setopt()


Related articles: