How to check curl is enabled or not in PHP

by garnet.barrows , in category: Technology , 3 years ago

How to check curl is enabled or not in PHP

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by bria_metz , 3 years 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";

}