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.
Related posts:


June 8th, 2010 at 8:19 am
I cannot get it to work. I’ve un-commented-out the thing in the ini file, and restarted my entire server, and all is NOT well, and it will NOT work. HELP!!
Windows Vista
April 23rd, 2011 at 9:47 am
very nice problem solved
July 30th, 2011 at 8:42 am
thank you.. it solved the issue..
August 22nd, 2011 at 8:21 am
i am using wndows XP and xampp server. i couldn’t found php.ini file.
please hlep
September 27th, 2011 at 3:57 pm
I have Vista, Apache, PHP 5.3.8
cUrl runs from command line
cUrl is activated (uncommented) in the PHP.INI file
the DLL is where all the others are
cUrl does NOT show up in PHPINFO
Still get “Call to undefined function: curl_init()”
I have no idea how to fix this.
This EXACT setup works fine on my XP Pro PC
Anyone?
December 17th, 2011 at 8:44 am
Thnx sir my problem is solved..:)
February 17th, 2012 at 12:04 pm
Walter, I had what sounds like the exact same problem as you but could find no help on the internet.
I finally solved it by adding the path to the curl dll to my PATH environment variable.
That is, I added:
C:\Program Files\PHP\ext\
to the windows system variable PATH, then restarted httpd.
I already had C:\Program Files\PHP\ in my path but it seems that was not enough.
Hope this helps you or somebody else.
- Michael