Checking for installed PHP extentions [solved]
Moderator: General Moderators
-
php_wiz_kid
- Forum Contributor
- Posts: 181
- Joined: Tue Jun 24, 2003 7:33 pm
Checking for installed PHP extentions [solved]
Is it possible to check for installed PHP extentions? I would like to check to see if the mysql or mysqli extensions are installed. Thanks.
Last edited by php_wiz_kid on Mon May 09, 2005 3:32 pm, edited 1 time in total.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Do you mean as part of an application or just in general?
Otherwise (untested but) I guess you could do something with ini_get();
Code: Select all
<? phpinfo(); ?>Code: Select all
<?php
if (!function_exists('mysql_connect'))
{
echo "mysql extension is not loaded.";
}
if (!function_exists('mysqli_connect'))
{
echo "mysqli extension is not loaded.";
}
?>Just use the extension_loaded function...
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
-
php_wiz_kid
- Forum Contributor
- Posts: 181
- Joined: Tue Jun 24, 2003 7:33 pm