How to check curl is enabled or not in PHP

Member

garnet.barrows

by garnet.barrows , in category: Technology , a month ago

How to check curl is enabled or not in PHP

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by bria_metz , a month ago

use function_exists('curl_version') function to check curl is enabled or not. This function returns true if curl is enabled other false

Example :

1
2
3
4
5
6
7
if(function_exists('curl_version') ){
  echo "Curl is enabled";
}else{

echo "Curl is not enabled";

}