463

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.

4
  • 6
    You don't have curl support in your PHP. This question has been asked many times here Commented Jun 17, 2011 at 7:20
  • 1
    for PHP7 ... I added php dir path in system enviroment varible, deleted libeay32.dll and ssleay32.dll from apache/bin, keep these dll in php directory and its work. Commented Mar 17, 2018 at 19:10
  • Had this problem but none of these answers worked. The one that did turned out to be here: askubuntu.com/questions/1116448/… Commented Jun 26, 2019 at 10:05
  • If all else fails, it maybe an incompatible (older) version of Apache. Upgrading from 2.4.18 to 2.4.46 fixed the problem for me and others. Commented Dec 30, 2020 at 17:49

2 Answers 2

935

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 
Sign up to request clarification or add additional context in comments.

24 Comments

Make sure you restart your Apache server after making this change.
If this doesn't work, check out this question. It provides a link for downloading a "fixed" php_curl.dll for PHP 5.3.13 (or 5.4.3). I had everything configured right but curl just wasn't being loaded (not showing up in phpinfo()). This fixed my issue.
if you are using from cmd, there is anoher php.ini file, more info there: stackoverflow.com/questions/2750580/…
on linux, you uncomment or add extension=php_curl.so in your php.ini and restart apache
sudo apt-get install php-curl then sudo service apache2 reload done!
|
18

The CURL extension ext/curl is not installed or enabled in your PHP installation. Check the manual for information on how to install or enable CURL on your system.

1 Comment

(Win32) I also had to add c:\php to my PATH. I learned that reading the manual from the link above. The manual said libeay32.dll and ssleay32.dll must both be on the PATH for the module to work.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.