Home >Backend Development >PHP Tutorial >Why Am I Getting \'Call to undefined function curl_init()\'?

Why Am I Getting \'Call to undefined function curl_init()\'?

Susan Sarandon
Susan SarandonOriginal
2024-11-02 21:52:02524browse

Why Am I Getting

Call to undefined function curl_init()? [duplicate]

When implementing the Authorize.net payment gateway, the error "Call to undefined function curl_init()" may arise. This error signifies that the PHP cURL extension is not enabled or installed.

Solution:

For Windows users:

  • Locate your php.ini file.
  • Uncomment the following line by removing the semicolon (;):

    extension=php_curl.dll
  • Save the php.ini file and restart your HTTP server (e.g., Apache).

For Ubuntu 13.0 and above users:

  • Install the debundled PHP cURL package:

    sudo apt-get install php-curl
    • Or, for PHP5:

      sudo apt-get install php5-curl
      • Or, for PHP5.6:

        sudo apt-get install php5.6-curl
  • Restart Apache to activate the package:

    sudo service apache2 restart

The above is the detailed content of Why Am I Getting 'Call to undefined function curl_init()'?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn