Does your web server have cURL enabled in PHP

I’m writing a script which might be generally of interest and it would be helpful to be able to use some functions from the PHP-cURL library. Research suggests that the PHP-cURL library is usually compiled into web servers that offer PHP but it’s often left disabled.

I’d like to get an idea of how available the library is on some of your web servers. If you would like to help, please create a file ‘curl_test.php’ in the root (usually public_html) of your web server and put the code below into it.

<?php
if(in_array  ('curl', get_loaded_extensions())) {
    echo "CURL is available on your web server";
}
else{
    echo "CURL is not available on your web server";
}
?>

Then in your web browser visit http://mydomain.com/curl_test.php (use https:// if your server has SSL enabled).

After getting the result, please delete the curl_test.php file and then answer the following poll:

Is the PHP-cURL library available on my web server?
  • Yes - PHP-cURL is available on my server
  • No - My server doesn’t have PHP
  • No - PHP-cURL isn’t available on my server but I can enable it myself if I needed it
  • No - PHP-cURL isn’t available on my server and I’d need to ask my server admin to enable it if I needed it
  • Other - Please add a comment to this thread
0 voters

I think you’ll find every user of PWS_Dashboard and/or Saratoga template has cURL enabled. . .

I also have to add a CURLOPT_PROXY to each and every script that uses cURL :wink:

Interesting. That suggests that it’s more generally available than my research found. Maybe I shouldn’t believe everything I read on the internet?

Mine has Curl enabled

I’ve found very few sites that DON’T have curl enabled by default … most of those were either ‘free’ sites with external connections denied as a default (but could be enabled by user control panel) that had curl, but was not functional. The other variety were self-hosted sites where the PHP installation was incomplete.

You can (reasonably) assume that modern PHP on commercial website hosters has curl enabled.

1 Like