How to enable cURL in PHP WAMP, XAMPP and Ubuntu Apache server

We all know the power of cURL, In short cURL is a library that lets you make HTTP requests in PHP ,In the part of web application development cURL must be enable in our web server, Because it is important to handle third party api request like SMS Gateway many more task you can easily handle with cURL.



Here we’ll learn the easy way to enable cURL in PHP. You only need to modify the php.ini file for enabling cURL in WAMP / XAMPP / Ubuntu Apache server.
enable-curl-in-php

Enabling cURL in WAMP Server

Step.1: Open the WAMP\bin\php\(php version)\php.ini file in any text editor.
Step.2: Search for curl, Uncomment the below line in the php.ini file by removing the semicolon (;).

;extension=php_curl.dll

Step.3: Open the WAMP\bin\Apache\(apache version)\bin\php.ini file in any text editor.
Step.4: Search for curl, Uncomment the below line in the php.ini file by removing the semicolon (;).

;extension=php_curl.dll

Note: Don’t forget to restart WAMP Server.

Enabling cURL in XAMPP Server

Step.1: Open the xampp\apache\bin\php.ini file in any text editor.
Step.2: Search for curl, Uncomment the below line in the php.ini file by removing the semicolon (;).

;extension=php_curl.dll

Note: Don’t forget to restart XAMPP Server.


Enabling cURL in Ubuntu Apache Server

Step.1: First install curl

sudo apt-get install php5-curl

Step.2: Restart Apache server.

sudo /etc/init.d/apache2 restart 
OR 
sudo service apache2 restart

Double check, is curl enable in php.ini file or not
Step.3: Open the etc/(php version)/(apache version)/php.ini file.
Step.4: Check following line should be uncomment, (;) should be removed.

extension=php_curl.dll

If you like this post please don’t forget to subscribe my public notebook for more useful stuff

One Reply to “How to enable cURL in PHP WAMP, XAMPP and Ubuntu Apache server”

  1. Hello sir,
    Currently I’m working working with laravel 5.3 and I have installed a package called guzzle for external API use. But as I m new with that can you please tell me how to register people in others website using their API. And login with that credentials.

    Thank you

    Regards
    Pravin

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.