How do I enable cURL in PHP?
apt-get install php5-curl
/etc/init.d/apache2 restart
(php4-curl if it's php4)
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.
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); Maybe that's the issue.Ensure extension_dir in php.ini is correctly set to the ext folder That did the job for me.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.
check if curl module is available
$ ls -la /etc/php5/mods-available/
enable the curl module
$ sudo php5enmod curl
If none of the above solves your problem and have installed with php-x86 (Windows 32 bit), then problem may be of openssl - for more info : How to fix libeay32.dll was not found error
Forget most of the above. I had the same problem and updated to Apache 2.4.58 and the problem went away. It was obviously an Apache bug.