This time i want to share with you how to install Curl in PHP5 in Linux Environtment (I’m using Ubuntu 8.10) and using apache web server, but if you have any question to install php-curl in other environment, feel free to contact me of leave any comment, i will glad to help you.
Okay, now let’s start with check if php-curl is already installed in your server or not.
To check it please follow this step:
- Create a file in your web server (in Ubuntu it would be in /var/www folder), name it info.php
- Open that file and type this command:
<?php phpinfo(); ?>
- Save that file
- Open your favorite browser and open that file (ex: http://localhost/info.php)
- Now you will see the Information about your PHP installation
- Search for Curl, and if you cannot find it, it mean your php doesn’t have curl installed.
To install php-curl please follow this steps:
- Open your terminal and type this command:
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl php5-mcrypt
- After it finish open php.ini file (mine is at /etc/php5/apache2/php.ini ) and add this command: extension=curl.so
- Save the file and restart apache with this command:
/etc/init.d/apache2 restart
- Check the PHP information page again, you will find PHP-CURL installed
- That’s it
Most hosting providers today already have Curl installed on their server.
Just a quick 'thank you' note for this.
I was trying to replace file_get_contents() with curl in some code. Of course it worked on my hosting server but not on my server at home. A quick phpinfo() had shown me the reason why already but your post saved me 15 minutes searching through documentation.
Thank you.
Just a quick ‘thank you’ note for this.
I was trying to replace file_get_contents() with curl in some code. Of course it worked on my hosting server but not on my server at home. A quick phpinfo() had shown me the reason why already but your post saved me 15 minutes searching through documentation.
Thank you.
'Open your terminal and type this command'. It is not clear about what terminal mentioned there. If it said as windows explorer window, so it is ok. But the terminal is confusing most.
‘Open your terminal and type this command’. It is not clear about what terminal mentioned there. If it said as windows explorer window, so it is ok. But the terminal is confusing most.
maybe to make some illustration or picture of the terminal, or the pathway, how to open this terminal…
Terminal mean your shell. If you're a linux/unix user, you should familiar with the word "terminal".
maybe to make some illustration or picture of the terminal, or the pathway, how to open this terminal…
Terminal mean your shell. If you’re a linux/unix user, you should familiar with the word “terminal”.
I run the command and I get a lot of 404 errors.
System indicates it needs to install extra packages and upgrade some. When it tries it show the 404 errors.
I have minimal experience on *nix and don't have a clue what to do.
Can you please suggest a way forward?
I run the command and I get a lot of 404 errors.
System indicates it needs to install extra packages and upgrade some. When it tries it show the 404 errors.
I have minimal experience on *nix and don’t have a clue what to do.
Can you please suggest a way forward?
Hi Gauti,
Which step produce 404 error?
What OS are you using? Because that command only run on Ubuntu/Debian.
Hi Gauti,
Which step produce 404 error?
What OS are you using? Because that command only run on Ubuntu/Debian.
I am using Ubuntu OS.
PHP 5.2.6.2
I get 404's for many of the PHP5 libraries being upgraded and also the curl libraries. The errors are similar to the ones below –
Err http://security.ubuntu.com intrepid-security/main linux-libc-dev
Err http://security.ubuntu.com intrepid-security/main lib-ssl-dev
Hi Gauti,
looks like your repo is not update.
Try this steps:
1. sudo apt-get autoclean
2. sudo apt-get update
3. sudo apt-get install curl libcurl3 libcurl3-dev php5-curl php5-mcrypt
Hope this help.
I am using Ubuntu OS.
PHP 5.2.6.2
I get 404’s for many of the PHP5 libraries being upgraded and also the curl libraries. The errors are similar to the ones below –
Err http://security.ubuntu.com intrepid-security/main linux-libc-dev
Err http://security.ubuntu.com intrepid-security/main lib-ssl-dev
Hi Gauti,
looks like your repo is not update.
Try this steps:
1. sudo apt-get autoclean
2. sudo apt-get update
3. sudo apt-get install curl libcurl3 libcurl3-dev php5-curl php5-mcrypt
Hope this help.
Hi Ivan,
Thanks that sorted the problem out.
Hi Ivan,
Thanks that sorted the problem out.
thanks dude 😉
thanks dude 😉
sudo apt-get install curl php5-curl
does it for me.
sudo apt-get install curl php5-curl
does it for me.
Thanks so much!!
Thanks so much!!
where in my php.ini file should I put line command: extension=curl.so
@henrik,
search your php.ini file with 'extension=' keyword.
You will see bunch of extension command there.
You can add it there.
Cheers.
where in my php.ini file should I put line command: extension=curl.so
@henrik,
search your php.ini file with 'extension=' keyword.
You will see bunch of extension command there.
You can add it there.
Cheers.
Ivan,
I am installing an ecommerce package on a new Ubuntu 10.04 server and your instructions worked perfectly.
Many Thanks!
Ivan,
I am installing an ecommerce package on a new Ubuntu 10.04 server and your instructions worked perfectly.
Many Thanks!
Thanks!
This worked perfectly on Debian 5. I got terrible confused when I was installing magento and it asked for curl..
Many thanks
My Pleasure 🙂
great post!!! Very helpful!!
Thanks a lot!
Carolina
worked with me
THANK YOU
You just saved my life….
One other thing: I did not have sudo installed… bummer, but I found this url:
http://www.debianhelp.co.uk/sudo.htm that helped me to install sudo. After that, all your steps were right to the point!
Thanks that was a big help.
Good tutorial,
as I’m new at ubuntu it was very helpful :).
Thank you very much 🙂
Very useful to enable a joomla plug-in
Thanks for the tip. Just what I needed for my paypal processing.
hey i need to configure curl for windows but cant…………
hey i need to configure curl for windows but cant…………
perhaps this link can help u ^o^
http://www.wallpaperama.com/forums/how-to-find-out-if-php-is-compiled-with-curl-extension-installed-enabled-t1576.html
Thanks mate
i wonder if you using IIS or apache?
thansk – the curl dev is important – else other mods fail to find the headers
Thank you very much! You help a lot.
Terimakasih! I got some errors on restarting apache, but it seems to be working fine.
i will lick to no more about the terminal commands and there are mining tans to u.. i hope to here if u… my name is lamptey from ghana email:[email protected]
Hi Ivan
Nice page,
I try to develop a facebook aplication in a free hosting but it shows "Facebook needs the CURL PHP extension." what can be? thanks
You need to install curl in your web server before it can connect to Facebook.
I LOVE YOU. YOU HAVE SAVED ME FROM JUMPING IN FRONT OF A TRUCK. I WAS ABOUT TO TAKE THIS COMPUTER AND THROW IT OUT THE WINDOW
Hi, this was very usfull. Thank you, you saved me a lot of time!
Kind Regards
Thanks! Was useful!
Awesome thanks mate
Hi,
I am getting the following error, kindly help.
————–
]# sudo apt-get install curl libcurl3 libcurl3-dev php5-curl php5-mcrypt
sudo: apt-get: command not found
—————
Thanks,
AS
that command only for ubuntu and debian. if you are using centos, fedora or RHEL use yum instead
Thanks alot, this saved me with installation of SugarCRm which needed the curl module enabled.
Worked perfectly for me .. thanks a ton.
Hey!
Thanks a lot for the help. I needed to enable curl for the WordPress Stats Dashboard.
Thanks… that's helpful. Another easy way is to install it using Ubuntu Software Center…
Thanks a lot for this easy to use config page!!
Greetings from Sweden
THX !
Still a few issues I had to run " /etc/init.d/apache2 restart " with sudo (as a super user aka root)
and the edit of "php.ini" was done using " sudo gedit php.ini " or directly using "sudo gedit /etc/php5/apache2/php.ini "
THX !
thanks man, it worked
Hi,
Just want to ask I follow the steps that you have.. but still i haven't install the cURL in my localhost it prompt me the below error.
Reading package lists… Done
Building dependency tree
Reading state information… Done
libcurl3 is already the newest version.
Package libcurl3-dev is a virtual package provided by:
libcurl4-openssl-dev 7.18.0-1ubuntu2.2
You should explicitly select one to install.
E: Package libcurl3-dev has no installation candidate
Please help I need this to install on my PC for testing purposes..
thanks.
update your repository. What ubuntu version are you using?
works fine, thx & merry christmas *<(:)-{)>
thanks
for those trying to install lately with ubuntu and didn't work with them, try first
sudo apt-get install curl php5-curl
in many cases this will be enough, if not, then proceed with the line in the article above it should run with no errors now.
it seems to me a broken dependency
Great.. thanks! this worked for me..
I want to install Curl into windows environment so please help me
thanks
sudo aptitude install php5-curl
works for me.
Very useful thank you…
Where do we type the command you mentioned? Do we do it in DOS?
No this article is for Ubuntu or Linux only. For Windows use xampp http://www.ivankristianto.com/web-development/server/local-server-for-testing-environment-with-xampp-on-windows/1566/ it's all there.
Thank you so much!
Thank you very much, easy to understand and works like a charm 🙂
Thanks!!!
Great Buddy, tanQ for this valuable information…now itz easy 4 me .
Veeery usefull, thanks for your valuable time.
Thank you very much, this article was useful for me
Beautiful! I was looking for just thing. Apt-get makes it so easy!
Thanks so much.
i m using wamp server in windows but in my php curl is not present so how can i install for windows curl?
Are you using XAMPP? or you just install everything manually?
Great… thanks!
For ubuntu server 11.04, the following works:
sudo apt-get install curl php5-curl
sudo /etc/init.d/apache2 restart
@bd123731de183ad12418f24a53a579b9:disqus — Thanks 🙂
Thank you, works fine on Debian Lenny!
Please enter a valid URL. Protocol is required (http://, https:// or ftp://)
Been doing everything from building php and libcurl from source, configuring php with the separately built curl module…. But couldn't make my apache server point to this newly-built php-bundle. But your two lines of instructions did the job! Thanks man! Thanks a lot!