Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call to undefined function curl_init().? [duplicate]

Tags:

php

curl

When i am going to implement Authorize.net payment gateway. However, I got this error:

Call to undefined function curl_init()

Please let me know what is wrong in it.

like image 247
Pramod Kumar Sharma Avatar asked Jun 17 '11 07:06

Pramod Kumar Sharma


People also ask

What is Curl_init?

The curl_init() function will initialize a new session and return a cURL handle. curl_exec($ch) function should be called after initialize a cURL session and all the options for the session are set. Its purpose is simply to execute the predefined CURL session (given by ch).

How check curl enabled or not in PHP?

Create phpinfo. php file and save. phpinfo; ?> Then go to http://domainname/phpinfo.php to check whether CURL is enabled or not.


1 Answers

If you're on Windows:

Go to your php.ini file and remove the ; mark from the beginning of the following line:

;extension=php_curl.dll 

After you have saved the file you must restart your HTTP server software (e.g. Apache) before this can take effect.


For Ubuntu 13.0 and above, simply use the debundled package. In a terminal type the following to install it and do not forgot to restart server.

sudo apt-get install php-curl 

Or if you're using the old PHP5

sudo apt-get install php5-curl 

or

sudo apt-get install php5.6-curl 

Then restart apache to activate the package with

sudo service apache2 restart 
like image 54
rahim asgari Avatar answered Sep 18 '22 11:09

rahim asgari