adoy / PHP-FastCGI-Client

Lightweight, single file, FastCGI client for PHP
MIT License
302 stars 61 forks source link

fcgiget non-zero exit status #20

Closed misterjoshua closed 3 years ago

misterjoshua commented 4 years ago

Hi I changed fcgiget.php so that when errors occur, the script will set a non-zero exit status rather than dying from an error and exiting with status 0. (Which means success despite the error.)

This was important to me when using fcgiget.php as an "exec" type livenessProbe in Kubernetes. I have fcgiget.php checking whether a FastCGI process is hung - Kubernetes restarts the container when the probe fails. Without a non-zero exit status, fcgiget.php was effectively failing to indicate that there was a problem accessing the FastCGI when the socket didn't exist or isn't writeable.