PHP CLI stopped working
<p>On my dedicated CentOS linux server my PHP CLI has stopped working. I have scripts written by a developer that require CLI and these scripts were working until yesterday. Another oddity that happened at the same time was that the symbolic link in /usr/local/bin/ to php was lost. I recreated that but it's still not working.</p>

<p>My developer says its not working because when we run this script from the command line;</p>

<pre><code>&lt;?php
echo 'php_sapi_name()='. php_sapi_name() .'&lt;br /&gt;';
if(php_sapi_name() == 'cli' &amp;&amp; empty($_SERVER['REMOTE_ADDR'])) {
echo "ENVIRONMENT IS CLI";
} ELSE {
echo "ENVIRONMENT IS NOT CLI";
}
//echo phpinfo();
</code></pre>

<p>From the command line then what is returned is</p>

<pre><code>php_sapi_name()=cgi-fcgi&lt;br /&gt;ENVIRONMENT IS NOT CLI
</code></pre>

<p>Running php -v gives me the following output</p>

<pre><code>PHP 5.3.8 (cgi-fcgi) (built: Feb  2 2012 14:48:13)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
</code></pre>

<p>Ended up changing our script to work around this problem but it's still odd how it just changed</p>
