Detect server PHP library support?

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

Detect server PHP library support?

Post by JAB Creations »

I've seen it done when I first started messing with cURL just over a year ago though I'm not sure how to detect if the cURL library is available to PHP? Nothing remotely related to my question si coming up on the search engines so could someone please point me in the correct direction? :)
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: Detect server PHP library support?

Post by Mark Baker »

if (function_exists('curl_version')) {
}
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Detect server PHP library support?

Post by jackpf »

Code: Select all

if(function_exist('curl_init'))
echo 'curl is available!';
else
echo 'curl not available <!-- s:( --><img src=\"{SMILIES_PATH}/icon_sad.gif\" alt=\":(\" title=\"Sad\" /><!-- s:( -->';
<span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span> hell, bug or what. 8O
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: Detect server PHP library support?

Post by JAB Creations »

Ha, I forgot about that function, thanks to both of you! :)
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Detect server PHP library support?

Post by jackpf »

Oh hey, Mark Baker didn't see your post!!
Post Reply