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
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
POST# 972
Posted On: Fri Feb 29, 2008 12:01 pm
web hosting
Topic: How To Find Out If PHP Is Compiled With CURL Extension Installed Enabled
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>';
?>


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"
}
}


Wed Jun 27, 2007 11:11 pm
1
Anilal
Reply #1696
it help me a lot to check it out... thanks a lot................
Tue Jan 01, 2008 6:32 pm
2
Alam
Reply #1697
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.

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload