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.
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 (;).
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 (;).
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 (;).
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.