我怎么知道 fastcgi_finish_request() 是否可用?

How do I know if fastcgi_finish_request() is available?

有没有类似的方法:

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

干杯

您可以使用 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.

用法示例:

if (function_exists('fastcgi_finish_request')) {
    fastcgi_finish_request();
}

fastcgi_finish_request() 不是一个模块而是一个函数,要检查你是否可以调用它你会这样做:

if (function_exists('fastcgi_finish_request')) {
  echo "fastcgi enabled";
}