How to Enable cURL in PHP?

cURL is a popular PHP library that provides functions for applications to transfer data over a variety of protocols, including HTTP, HTTPS, FTP, and more. It can be used to fetch resources from a server, submit data to a server, or both. cURL is easy to use and well-documented.

To use cURL, you must have the file installed somewhere on your server. When you see the error message “Fatal error: Call to undefined function curl_init(),” it means that the server you’re working on doesn’t have cURL enabled. In order to use the curl_init() function (or any other cURL functions), cURL must be enabled on the server.

Steps to enable cURL:

  • Open php.ini with a text editor. The file can be a located in different folder depending on your server’s OS or software. For example, C:\xampp\php\php.ini for XAMPP or /etc/php/7.2/apache2/php.ini for Debian Apache.
  • Jump to ;extension=curl line and emove the ; character.
  • Restarting Apache/nginx server to make the change take effect.
Scroll to Top

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.