0
存在以下問題:我必須檢測FastCGI SAPI才能發送自定義響應。對於FastCGI,它看起來像是'未找到狀態404',而不是'HTTP/1.1 404 Not Found'。就我所知,PHP僅將FastCGI作爲FPM的一部分來實現。使用PHP檢測FastCGI SAPI
因此,它是檢測FastCGI的正確方法:
if (preg_match('|fpm|', PHP_SAPI))
print('FastCGI');
http://stackoverflow.com/questions/609044/how-to-know-for-sure-if-fastcgi-is-being-used-to-run-php-scripts – 2013-02-26 08:31:37
您確定需要發送自定義響應?請參閱[this stackoverflow post](http://stackoverflow.com/questions/8828275/still-necessary-to-use-status-404-not-found-for-fcgi)瞭解更多關於HTTP vs Status和FCGI的信息 – alldayremix 2013-02-26 08:35:18
Yeah ,可能這就是我需要的。 – 2013-02-26 09:22:28