ChatGPT解决这个技术问题 Extra ChatGPT

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

This question already has answers here: PHP Fatal error: Call to undefined function curl_init() (24 answers) Closed 4 years ago.

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.

You don't have curl support in your PHP. This question has been asked many times here
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.
Had this problem but none of these answers worked. The one that did turned out to be here: askubuntu.com/questions/1116448/…
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.

J
Johan

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

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!
S
Stefan Gehrig

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.


(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.