GD and cURL at wamp

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shafiq2626
Forum Commoner
Posts: 88
Joined: Wed Mar 04, 2009 1:54 am
Location: Lahore
Contact:

GD and cURL at wamp

Post by shafiq2626 »

hello
how we can check that our GD and cURL is working in our wamp server.
pls help
thanks
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: GD and cUEL at wamp

Post 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.
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: GD and cURL at wamp

Post 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! :)
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

Re: GD and cURL at wamp

Post by php_east »

Code: Select all

$ch = curl_init();
if (is_resource($ch)) 
{echo 'cURL is supported';}
else 
{echo 'cURL is not supported';}
 
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: GD and cURL at wamp

Post by JAB Creations »

php_east, if cURL is not present then that will trigger an error. You gotta test your code out first. :P
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

Re: GD and cURL at wamp

Post by php_east »

okay, :drunk:

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';}
}
 
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: GD and cURL at wamp

Post by JAB Creations »

Ah that's cool. 8) 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?
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

Re: GD and cURL at wamp

Post by php_east »

correct.
shafiq2626
Forum Commoner
Posts: 88
Joined: Wed Mar 04, 2009 1:54 am
Location: Lahore
Contact:

Re: GD and cUEL at wamp

Post 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
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: GD and cURL at wamp

Post 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.
Post Reply