cURL allows you to connect and communicate to many different types of servers with many different types of protocols. Currently protocols support by cURL are http, https, ftp, gopher, telnet, dict, file, and ldap.
To install cURL in Linux based operation system, you need to login to SSH command and install cURL library for PHP. Use following command to install cURL in PHP-5:
1 |
apt-get install php5-curl |
For PHP-4, use following:
1 |
apt-get install php4-curl |
Once you have installed the cURL, you need to restart your Apache server to make it effective. Use following line to restart Apache server:
1 |
sudo service apache2 restart |
Now for Windows based operating system. Procedure is bit different, where you have to edit existing file to enable cURL. Basically Windos OS doesn’t support PHP on its own so we use XAMPP software.
To enable cURL in XAMPP, you need to edit the php.ini file and uncomment a line which stop cURL to work.
File will be located in:
1 |
~xamppphpphp.ini |
Search for the line where it shows:
1 |
;extension=php_curl.dll |
and un-comment it by remove ” ; ” before line and it should look like below:
1 |
extension=php_curl.dll |
Here also we need to restart Apache server to make this tweak working using below command:
1 |
sudo service apache2 restart |
Note and Conclusion:
To make changes effective and enable cURL, you need to restart Apache server every time if you modify any php or apache modules.
I hope it will work out, if not then comment below. We will be happy to help you.