Enable cURL in PHP for Linux and Windows on XAMPP

Guide on installing and enabling cURL in php-5 and php-4 for Linux and Windows based operating systems on Apache server.

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:

For PHP-4, use following:

Once you have installed the cURL, you need to restart your Apache server to make it effective. Use following line to restart Apache server:

Related:  How to add Swap file on Ubuntu Web Server ?

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:

Search for the line where it shows:

and un-comment it by remove ” ; ” before line and it should look like below:

Related:  Enable Apache mod_headers and mod_expires modules

Here also we need to restart Apache server to make this tweak working using below command:

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.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *