Wednesday, March 9, 2011

How to install cURL

If you are making your first shopping cart, crawler or simply need cURL to make existing code work, here's how to get it.

First things first, check to see if cURL is already running. Create the following PHP page:
<?php
   phpinfo();
?>
Visit that page and search for "curl". If nothing is found, you don't have cURL. A proper installation should have a reference under "Additional .ini files parsed" as well as a section called "curl" with all the details.

There are several ways to install/enable cURL, depending on your setup. Here are the two most common:

LAMP (as root or using sudo)
apt-get install curl libcurl3 libcurl3-dev php5-curl php5-mcrypt
XAMPP (edit xampp\apache\bin\php.ini and uncomment or add this line)
extension=php_curl.dll
In either case you'll need to restart Apache to load cURL after the installation.

To verify the installation, go to the PHP page you created and search for "curl".

No comments:

Post a Comment