Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enable curl for php

I'm using NGINX with PHP-FPM on Debian Wheezy via DotDeb repo.

This is the only curl reference in my php.ini file and I'm not sure what I need to do. Any help is appreciated (it's already installed)

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
;curl.cainfo =

; Local Variables:
; tab-width: 4
; End:
like image 520
user1446650 Avatar asked Apr 23 '14 01:04

user1446650


People also ask

Can I use cURL in PHP?

Uses of cURL in PHPcURL 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.

How do you check PHP cURL is enabled or not?

Create phpinfo. php file and save. phpinfo; ?> Then go to http://domainname/phpinfo.php to check whether CURL is enabled or not.


1 Answers

Check whether you have php5-curl installed

dpkg -l | grep 'php5-curl'

If isn't installed,

apt-get install php5-curl

Ensure the path in extension_dir exists, and contains curl.so, if not, change to the correct path.

php -i | grep extension_dir

Ensure the /etc/php5/mods-available/curl.ini exists and has the curl.so loaded

; configuration for php CURL module
; priority=20
extension=curl.so

If everything is correct, restart PHP-FPM

/etc/init.d/php5-fpm restart
like image 56
Tan Hong Tat Avatar answered Sep 22 '22 23:09

Tan Hong Tat