1

Is there any approach like:

if (extension_loaded('apc') && ini_get('apc.enabled'))
{
echo "APC enabled!";
}

Cheers

EricLavault
  • 12,130
  • 3
  • 23
  • 45
SimBioT
  • 59
  • 4
  • 12

2 Answers2

2

You can test with function_exists():

Checks the list of defined functions, both built-in (internal) and user-defined, for function_name […] Returns TRUE if function_name exists and is a function, FALSE otherwise.

Example usage:

if (function_exists('fastcgi_finish_request')) {
    fastcgi_finish_request();
}
Gordon
  • 312,688
  • 75
  • 539
  • 559
1

fastcgi_finish_request() is not a module but a function, to check if you can call it you would do :

if (function_exists('fastcgi_finish_request')) {
  echo "fastcgi enabled";
}
EricLavault
  • 12,130
  • 3
  • 23
  • 45