How to check cURL is install or not on server in PHP

To check cURL we need to check PHP extension –
function _is_curl_installed() {
if  (in_array  (‘curl’, get_loaded_extensions())) {
return true;
}
else {
return false;
}
}

// Output text to user based on test
if (_is_curl_installed()) {
echo “cURL is <span style=\”color:blue\”>installed</span> on this server”;
} else {
echo “cURL is NOT <span style=\”color:red\”>installed</span> on this server”;
}

One Reply to “How to check cURL is install or not on server in PHP”

Leave a Reply

Your email address will not be published. Required fields are marked *