How do I enable cURL in PHP?
Actually I did it by uncommenting extension=php_curl.dll
in the xampp\apache\bin\php.ini file.
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
.
PHP 7^ version:
sudo apt-get install php-curl
sudo service apache2 restart
You can check phpinfo()
(create a script containing and browse to it). This will tell you if you really do have it enabled. If not, read here.
It is not recommended for the faint-hearted Windows developer.
For windows OS users (It worked for me) in XAMPP.
step 1: Go to C:\xampp\php\php.ini
edit this file php.ini
find curl- you will see a line ;extension=php_curl.dll.
remove semicolon (;)extension=php_curl.dll. so this line looks like
;extension=php_curl.dll
to
extension=php_curl.dll
step 2: copy ssleay32.dll, libeay32.dll from php folder. paste it in C:\Windows\System32\
step 3: Restart the system . Curl will run successfully.
On Debian with Apache 2:
apt-get install php5-curl
/etc/init.d/apache2 restart
(php4-curl if it's php4)