html – Fatal error: Call to undefined function curl_init() in C:\xampp\htdocs\otp\textlocal.class.php on line 102-ThrowExceptions

Exception or error:

I am developing a new project for Event Management. For that, I need to implement OTP verification for mobile numbers for those who are registering for the event. I’m using textlocal API to send OTP and I’m getting the error as above.

How to solve:

In windows: in your php.ini file and remove the comment from cURL extension

change ;extension=curl to extension=curl


For Ubuntu:

 sudo apt-get install php-curl 

or

 sudo apt-get install php5-curl

After you have saved the file you must restart your HTTP server software (e.g. Apache) before this can take effect.

and check into the phpinfo that your cURL extension is enabled or not


enter image description here

Leave a Reply

Your email address will not be published. Required fields are marked *