PHP - Enable cURL in Windows

By xngo on September 2, 2019

Issue

If you execute curl_init(); statement without enabling the cUrl extension, you will get the following error:

PHP Fatal error:  Uncaught Error: Call to undefined function curl_init()

Solution

Locate php.ini

You can locate your php.ini by using the output of <?php phpinfo(); ?> or if it doesn't exist, copy from php.ini-development to create 1.

Enable php_curl

Open php.ini and change ;extension=curl to

;extension=C:\php-7.3.8-Win32-VC15-x86\ext\php_curl.dll

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.