How to find php functions enabled by php.ini

Post Reply
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

How to find php functions enabled by php.ini

Post by Neo » Sun Jul 10, 2011 7:48 pm

Here is a way to find php functions enabled by php.ini by default. I had to find this when I needed to check whether fsockopen function is available by default. Very useful for anybody.

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 

<html> 
<head> 
    <title><?=$_SERVER['HTTP_HOST']?> - PHP Functions</title> 
</head> 

<body> 
<H1>PHP Functions for <?=$_SERVER['HTTP_HOST']?></H1> 
<?php  

if(function_exists('imagetypes')) 
 echo 'GD is loaded<br>'; 
else 
 echo 'GD is not loaded<br>'; 

$extensions = get_loaded_extensions(); 
sort($extensions); 
echo "\n\n<table border=\"1\">\n"; 


foreach( $extensions as $extension ) 
{ 
    echo "<tr>\n\t<td valign=\"top\"><b>$extension</b></td>\n\t<td>"; 
    $functions = get_extension_funcs( $extension ); 
    if ($functions) { 
        sort($functions); 
        foreach( $functions as $function ) 
        { 
            echo "$function<br>"; 
        } 
    } 
    echo "</td>\n</tr>\n"; 
} 
echo "</table>\n"; 
?> 

</body> 
</html>
Post Reply

Return to “PHP & MySQL”