cURL is a useful PHP library that allows you to connect to servers using a variety of different protocols. These include HTTP,FTP, LDAP and HTTPs.
The following PHP script allows you to check if it is enabled on your web server. If your server is provided by a web hosting company this will allow you determine if it is available to you. Some web hosts may disable cURL which would stop some PHP
scripts from running properly.
To use the curl check script paste the following in a text file named "curl_check.php" :
<?php
// Script to test if the CURL extension is installed on this server
// Define function to test
function _is_curl_installed() {
if (in_array ('curl', get_loaded_extensions())) {
return true;
}
else {
return false;
}
}
// Ouput 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";
}
?>
<?
phpinfo();
?>