title: How should I to set the error log for PHP CLI?
body: <p>I have a PHP script running just fine through Apache, but it fails when running in CLI, so I want to find out what is happening.</p>
  <p>For this, I'd like to see the error log, but the CLI error log I set is not working. I have set this in the proper <em>php.ini</em> file, which is confirmed when I obtain the error log details through the command line:</p>
  <pre class="lang-none prettyprint-override"><code>php -i | grep error
  </code></pre>
  <p>Result:</p>
  <pre class="lang-none prettyprint-override"><code>display_errors =&gt; Off =&gt; Off
  display_startup_errors =&gt; Off =&gt; Off
  error_append_string =&gt; no value =&gt; no value
  error_log =&gt; /var/log/php_error_log =&gt; /var/log/php_error_log
  error_prepend_string =&gt; &lt;font color=ff0000&gt; =&gt; &lt;font color=ff0000&gt;
  error_reporting =&gt; 30711 =&gt; 30711
  html_errors =&gt; Off =&gt; Off
  ignore_repeated_errors =&gt; Off =&gt; Off
  log_errors =&gt; On =&gt; On
  log_errors_max_len =&gt; 1024 =&gt; 1024
  track_errors =&gt; Off =&gt; Off
  xmlrpc_error_number =&gt; 0 =&gt; 0
  xmlrpc_errors =&gt; Off =&gt; Off
  suhosin.disable.display_errors =&gt; Off =&gt; Off
  suhosin.sql.bailout_on_error =&gt; Off =&gt; Off
  </code></pre>
  <p>So <code>error_log</code> and <code>log_errors</code> are both set. However, no logs are actually saved. Permissions are in place. So what can it be?</p>
  <p>I've read the question <em><a href="https://stackoverflow.com/questions/6387542/php-cli-wont-log-errors">PHP CLI won&#39;t log errors</a></em>, but I could not find a solution in there.</p>