Page 1 of 1
GD and cURL at wamp
Posted: Thu Mar 26, 2009 7:30 am
by shafiq2626
hello
how we can check that our GD and cURL is working in our wamp server.
pls help
thanks
Re: GD and cUEL at wamp
Posted: Thu Mar 26, 2009 7:47 am
by JAB Creations
I tried the following though it doesn't work. Unfortunately PHP doesn't do "object detection" like JavaScript does.
Code: Select all
<?php
$ch = curl_init();
if ($ch) {echo 'cURL is supported';}
else if (!$ch) {echo 'cURL is not supported';}
?>
I remember some file I had (though can not find when I just looked) that would detect what libraries are present. I'm subscribed because now I'm curious about this too.
Re: GD and cURL at wamp
Posted: Thu Mar 26, 2009 7:51 am
by JAB Creations
Ha! I'm sorry I should have remembered the function
function_exists.
Code: Select all
<?php
if (function_exists('curl_init')) {echo 'cURL is available';}
else {echo 'cURL is not available.';}
?>
You can probably do the same thing with the GD library. Good luck!

Re: GD and cURL at wamp
Posted: Thu Mar 26, 2009 8:00 am
by php_east
Code: Select all
$ch = curl_init();
if (is_resource($ch))
{echo 'cURL is supported';}
else
{echo 'cURL is not supported';}
Re: GD and cURL at wamp
Posted: Thu Mar 26, 2009 8:01 am
by JAB Creations
php_east, if cURL is not present then that will trigger an error. You gotta test your code out first.

Re: GD and cURL at wamp
Posted: Thu Mar 26, 2009 8:13 am
by php_east
okay,
Code: Select all
if (function_exists('curl_init'))
{
$ch = curl_init();
if (is_resource($ch))
{echo 'cURL is supported';}
else
{echo 'cURL is not supported';}
}
Re: GD and cURL at wamp
Posted: Thu Mar 26, 2009 8:20 am
by JAB Creations
Ah that's cool.

Technically I suppose you could create a function called 'curl_init' but it wouldn't be a resource but rather simply a function I presume?
Re: GD and cURL at wamp
Posted: Thu Mar 26, 2009 8:51 am
by php_east
correct.
Re: GD and cUEL at wamp
Posted: Fri Mar 27, 2009 6:26 am
by shafiq2626
JAB Creations wrote:I tried the following though it doesn't work. Unfortunately PHP doesn't do "object detection" like JavaScript does.
Code: Select all
<?php
$ch = curl_init();
if ($ch) {echo 'cURL is supported';}
else if (!$ch) {echo 'cURL is not supported';}
?>
I remember some file I had (though can not find when I just looked) that would detect what libraries are present. I'm subscribed because now I'm curious about this too.
Thanks For This.
I test with ur code then this show with success.
I want to Create New Skin with CubeCart Can u help me how can this possible.
thanks
Re: GD and cURL at wamp
Posted: Fri Mar 27, 2009 11:44 am
by JAB Creations
One thread one topic. That's the point of having a forum. Not only do you might get an answer in a thread others will find the archive version of it too. Start a new thread though you should Google something like that.