- Linux Systems
- How To Find Out If Php Is Compiled With Curl Extension Installed Enabled
this post shows you how how to find out if php is compiled with curl extension and its installed or how to verify if its enabled in your php configuration settings , Last Updated: Sun Jun 14, 2020
Thu Jun 21, 2007
at some point, you will find out that some scripts require you to have cURL extension enabled in your web server.
well, how can you tell whether the CURL extension is enabled or compiled in your PHP?
these are the steps to take:
1. open a blank text document. i will be using notepad in windows.
2. copy and paste this code into notepad and save it as testcurl.php
## Test if cURL is working ##
## SCRIPT BY WWW.WEBUNE.COM (please do not remove)##
3. if you prefer, you can download the full script at this link:How To Check Curl Installed In Php
4. IF IT FAILS:
if there was an error, then it means that you do not have this extension enabled. and you will see an error similar to this one:Fatal error: Call to undefined function curl_version() in testcurl.php on line 2
HOW TO FIX IT:
open you php.ini file and look for this line:extension=php_curl.dll
this is how my server was:
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
If you notice, i have a semi-colon (;) before extension=php_curl.dll
so all you have to do is to remove that semi-colon save your php.ini file and restart your server. now try to open your testcurl.php file with your browser and this time you should not get this error anymore.
5. IF SUCCESS.
if you have extension=php_curl.dll
enabled, then you will see something like this:
string(15) " OpenSSL/0.9.7c"
Here is a good tutorial explaining how to use cURL:
Now i just have to figure out how i can do this on a linux server. if anyone knows how to activate it in a linux machine, let me know please