Thankfully, XAMPP installs the cURL library during its installation but it is not enabled by default, you have to manually enable it. However, it is easy, go to the XAMPP folder and open the php. ini file from the path ../apache/bin/php.
cURL is a PHP extension that allows you to use the URL syntax to receive and submit data. cURL makes it simple to connect between various websites and domains. Obtaining a copy of a website's material. Submission of forms automatically, authentication and cookie use.
cURL with respect to PHP is a library that lets us make HTTP requests in PHP. It's easier to do GET/POST requests with curl_exec to receive responses from other servers for JSON format data response and to download files. Required to “enable” cURL: The cURL, by default, is not enabled in Apache.
On Debian with Apache 2:
apt-get install php5-curl
/etc/init.d/apache2 restart
(php4-curl if it's php4)
Since you're using XAMPP, uncomment the line
;extension=php_curl.dll
in xampp\apache\bin\php.ini
, and then restart the Apache service.
NB: In newer XAMPP versions, PHP has moved to root xampp folder xampp\php\php.ini
.
Steps for Windows 7:
extension=php_curl.dll
in the php.ini is uncommentedFinally and maybe the one most people don't know:
4. Ensure that there are these two files in the Windows System32 folder:
libeay32.dll
ssleay32.dll
If not there, you may copy these two files from the php
folder.
I found the file located at:
C:\xampp\php\php.ini
Uncommented:
;extension=php_curl.dll
For Ubuntu (and probably all Debian-Based) Linux Distributions:
sudo apt-get install php5-curl
sudo /etc/init.d/apache2 restart
You might have seen PHP Fatal error: Call to undefined function curl_init()
before.
In SUSE Linux:
zypper in php5-curl
rcapache2 restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With