Fatal error: Call to undefined function curl_init() Windows and Linux (Ubuntu)

If you are getting the following error while browsing any website in Windows or Linux (Ubuntu) like:

Fatal error: Call to undefined function curl_init()

then here is a simple and easy solution, for both Windows and Linux (Ubuntu) users.

For Windows

If you are having the error Call to undefined function curl_init() in Windows, then you have to simply modify a line in apache’s php.ini file.

Goto your wamp folder, which would be like:

D:\wamp\bin\apache\apache2.2.6\bin\

And open the file

php.ini

If you are unbable to find the folder of file as mentioned above, or if you are using some other server in Windows, then simply find the php.ini file located under apache folder (and not php folder), and open it in a text editor.

Find the text

extension=php_curl.dll

and remove the semi-colon at the start.

Now that line would look like:

extension=php_curl.dll

(without semi-colon on start)

Save the file, and restart your Apache Server. And the problem is solved.

For Ubuntu (Linux)

If you are having the error Call to undefined function curl_init() in Ubuntu or Linux, then you have to simply install php5-curl to make this problem resolved.

Simply goto:

System -> Administration -> Synaptic Package Manager

And find the package or software as “php5-curl“ or php curl

and install the CURL module for PHP. After successful installation, restart your Apache Server with the following command:

sudo /etc/init.d/apache2 restart

And the problem is solved.

Or

Or goto gnome-terminal, and write the following command:

sudo apt-get install php5-curl

(if php5 is not the latest php version, then find the latest php curl package and install it)

After successful installation, restart your Apache Server with the following command:

sudo /etc/init.d/apache2 restart

And the problem is solved.

Uncategorised
One comment to “Fatal error: Call to undefined function curl_init() Windows and Linux (Ubuntu)”
  1. Pingback: Send SMS PHP Script / API Through Mobile - Web Tech Query

Leave a Reply

Your email address will not be published.