Fatal error: call to undefined function curl_init()

Views: 12 Last modified: July 31st, 2011 Comments: 0

If you want to use any of the libcurl (library) functions, like curl_init(), you have to load a particular extension (windows). This extension can be found in your PHP extension (\ext (by default)) folder on your webserver.
If you don’t load this extension, PHP throws fatal errors as it wasn’t able to find the specific function.

The file name of this extension is:

php_curl.dll

Now you know where to find this extension, you have to enable it.

This file name can also be found in your PHP configuration file (php.ini). Go to your windows extensions area and look for the next line:

extension=php_curl.dll

As you can see, there are quite more of the same lines, starting with “extension=”. Here you can enable or disable specific extension for loading with PHP, by simply adding or removing the semicolons (;) in front of the lines. Line’s with semicolons in front of it, are comment lines and ignored when the script runs. So you have to remove the semicolon if you want to use the specific extension.

If you didn’t found this line, please add it to the configuration file, just on the bottom of the list of all other extensions.

Save your php.ini file and restart your webserver. Now you are able to use any of the libcurl library functions.

VN:F [1.9.13_1145]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

    Mail this!

    To: From:Sum {6+8} =  
    Anything to add ?

        You must be logged in to post a comment.