Home » Interview Question » CURL » Call to undefined function curl_init() in PHP

Call to undefined function curl_init() in PHP

Some time when we are using any php extension function we are getting “Fatal error: Call to undefined function imap_open() in PHP” or “Fatal error: Call to undefined function curl_init() in PHP” and any other Php library function.

This problem is arise when we are not enable extension(like CURL,GD extension and IMAP) and used function from these library. and due to some new and old core php function which are depreciated in and not supported in your current php version. Then we are getting these type of error.

If you are getting “Fatal error: Call to undefined function curl_init() in PHP”: It means CURL extension is not enabled on your server. To remove these type of sever required to enabled curl extension on your server.

To Enabled curl on Your Server
After enbled curl on your server.Kindly restrat apache server and refresh the application, Now your code is working fine.

If you are getting “Fatal error: Call to undefined function imap_open() in PHP”: It means IMAP extension is not enabled on your server. IMAP extension default is deactivated in XAMPP.To remove these type of sever required to enabled IMAP extension on your server.

To Enabled IMAP on Your Server Follwing below steps.

  1. Go To \xampp\php\php.ini on your server.
  2. Open your php.ini file on your feavrate editor.
  3. To activate the IMAP exstension find “extension=php_imap.dll” line in “php.ini” file and remove the beginning semicolon from the line “;extension=php_imap.dll”.
  4. Don’t forgot to Restart the Apache server, without Restarting Apache server your changes not impact.
  5. Kindly Restart Apache server and refresh the application, Now your code is working fine.
, , , ,

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">