how to find out if php is compiled with curl extension installed enabled

Mobile
feeds
Welcome Login | Register

how to find out if php is compiled with curl extension installed enabled
Reply Your Comments:
Click this button if you are interested in replying to this topic and leave your comments
Sent To Friend
CLick this button if you want to send this page to a friend.
Subsribe To Rss Feeds
Subscribe to RSS
CLick this button if you want to subscribe to this RSS Feed. You can use your browsers feeds burners if you have mozilla or internet explorer 7 or higher and keep up with updates.
  Forums Index
      » Linux Forums
        » » how to find out if php is compiled with curl extension installed enabled
how to find out if php is compiled with curl extension installed enabled
Post Description: how to find out if php is compiled with curl extension installed enabled Linux
Post Tags:
This Post Has Been Viewed 1968 Times Since Thu Jun 21, 2007 1:32 pm Author hostman with 15 replies
how to find out if php is compiled with curl extension installed enabled
Advertise On This Page




at some point, you will find out that some scripts require you to have cURL extension enabled in your web server.

whell, 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
<?php
echo '<pre>';
var_dump(curl_version());
echo '</pre>';
?>


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:



;Windows Extensions
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.


;extension=php_adt.dll
;extension=php_apd.dll
;extension=php_blenc.dll
;extension=php_bz2.dll
;extension=php_bz2_filter.dll
;extension=php_cpdf.dll
;extension=php_crack.dll
;extension=php_curl.dll
;extension=php_date.dll
;extension=php_db.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_dio.dll
;extension=php_domxml.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_ffi.dll
;extension=php_filepro.dll
;extension=php_fribidi.dll
extension=php_gd2.dll

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:
array(9) {
["version_number"]=>
int(461570)
["age"]=>
int(1)
["features"]=>
int(540)
["ssl_version_number"]=>
int(9465919)
["version"]=>
string(6) "7.11.2"
["host"]=>
string(13) "i386-pc-win32"
["ssl_version"]=>
string(15) " OpenSSL/0.9.7c"
["libz_version"]=>
string(5) "1.1.4"
["protocols"]=>
array(9) {
[0]=>
string(3) "ftp"
[1]=>
string(6) "gopher"
[2]=>
string(6) "telnet"
[3]=>
string(4) "dict"
[4]=>
string(4) "ldap"
[5]=>
string(4) "http"
[6]=>
string(4) "file"
[7]=>
string(5) "https"
[8]=>
string(4) "ftps"
}
}



Leave Your Comments

Your Name
Your Email Address (Will Not Be Published)
Notify Me When Someone Replies to this Page
(An email will be sent to you when someone replies to your comments)
Your Comments
Include A Picture with your comments
Share
| More
Share this page by putting this URL in your comments to other websites like myspace, Facebook, Twitter friendster, Hi5, Groups, Boards, Forum or others. Just Copy and Paste this Code
URL:
To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it.
Embed:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
BBCODE:
Subscribe Feeds
Webmasters - Exchange Links With Us. Add related websites to this topic
Add Link:
Links Related to : how to find out if php is compiled with curl extension installed enabled

Comments and replies About how to find out if php is compiled with curl extension installed enabled
:: 1 :: Reply #8608 Reply By Anilal On Wed Jun 27, 2007 11:11 pm
Anilal:
it help me a lot to check it out... thanks a lot................
:: 2 :: Reply #34037 Reply By Alam On Tue Jan 01, 2008 6:32 pm
Alam:
hi

i have been reading your tutorial on how to get curl enabled with php. i went into /root/ispconfig/php and remove semicolon; from where it said ;extension=php_curl.dll

i realized as i am using ubuntu 7.10 i need to add a line just where it say dynamic extensions, like this extension=php_curl.so

which i did and restarted the server. afterwards i tried to get the testcurl.php in browser i am still getting this message

"fatal error: call to undefined function curl_version() in /home/admispconfig/ispconfig/web/testcurl.php on line 3"

any help on that will be much appreciated.

:: 3 :: Reply #77038 Reply By vani On Thu Oct 23, 2008 10:35 pm
vani:
how to find out if php is compiled with curl extension installed enabled??

not solved but the above steps...
:: 4 :: Reply #87124 Reply By SHUNMUGASUNDARAM On Sun Dec 21, 2008 10:11 pm
SHUNMUGASUNDARAM:
sir
i worked in xampp and also download php_ffi.dll function where to i install this dll file please explain because many folders in xampp file thank you
:: 5 :: Reply #88319 Reply By arasu On Thu Jan 01, 2009 5:42 am
arasu:
hi
i got "the ordinal 110 could not be located in the dynamic link library ssleay32.dll" while restart my apache server, what can i do?.
:: 6 :: Reply #93204 Reply By Shivam On Sat Feb 07, 2009 8:39 pm
Shivam:
on a linux hosting server, the output is as shown below if curl is installed and enabled:


string(55) "libcurl/7.19.2 openssl/0.9.7a zlib/1.2.1.2 libidn/0.5.6"

the output shown above(in the original article) is for a windows web-server.
:: 7 :: Reply #102235 Reply By yit On Sun May 03, 2009 9:22 pm
yit:
easy! thanks for the simple tutorial.
:: 8 :: Reply #108731 Reply By Lelin On Wed Jul 08, 2009 10:22 pm
Lelin:
thank you very much.its a very good tutorial.
:: 9 :: Reply #111358 Reply By amprodes On Sat Aug 01, 2009 8:31 pm
amprodes:
what about linux? those libraries are for windows only but for linux what?
:: 10 :: Reply #124189 Reply By xvader On Wed Dec 23, 2009 8:28 pm
xvader:
23-1576-c8fbd98f98.jpg
sorry to say this, but i'm a newbie. i've tried your code above to find out whether curl is already installed/configured correctly in my (linux) hosting server but the result shows as seen below:

array(x) {
["version_number"]=>
int(4333zy)
["age"]=>
int(3)
["features"]=>
int(y434)
["ssl_version_number"]=>
int(x)
["version"]=>
string(3) "z.yx.4"
["host"]=>
string(yz) "i3y3-pc-linux-gnu"
["ssl_version"]=>
string(y4) "openssl/x.x.yb"
["libz_version"]=>
string(4) "y.z.3"
["protocols"]=>
array(y) {
[x]=>
string(4) "tftp"
[y]=>
string(3) "ftp"
[z]=>
string(3) "telnet"
[3]=>
string(4) "dict"
[4]=>
string(4) "http"
[4]=>
string(4) "file"
[3]=>
string(4) "https"
[z]=>
string(4) "ftps"
}
}

what does that mean?
:: 11 :: Reply #124193 Reply By wallpaperama On Wed Dec 23, 2009 9:22 pm
wallpaperama:
it means you have extension=php_curl.dll enabled
:: 12 :: Reply #128980 Reply By Ranjith On Fri Feb 26, 2010 9:01 pm
Ranjith:
Thanks Man. My video blog required curl and i wanted to check if it was working..This really helped..!!
:: 13 :: Reply #129342 Reply By Leigh... On Thu Mar 04, 2010 7:30 pm
Leigh...:
Thank you very much. this was helpful for me.

Good job

Leigh...
:: 14 :: Reply #129960 Reply By harsh On Mon Mar 15, 2010 11:02 am
harsh:
helped me a lot really, & regd amprodes comments, it works on linux too, worked with my rhel as well as debian apache distros.

thanks
:: 15 :: Reply #129961 Reply By TK On Mon Mar 15, 2010 11:19 am
TK:
Thank you so much, it worked. That was easy :)