How to get command line errors in the PHP error log file
<p>I'm trying to run the <code>curl</code> command in PHP file and am trying to list its output in the error log file. All the PHP errors are listed in the file except the errors I get from <code>exec()</code> function. The PHP code I'm trying is:</p>
<pre><code>exec(&quot;nohup curl --output &quot; . $_SERVER['DOCUMENT_ROOT'] . &quot;/abc.mp3 http://192.99.8.170:8098/stream/1; --max-time $time_in_seconds &gt; /devnull&amp;&quot;);
</code></pre>
<p>How could I get the error generated by this command in the error log file? I have googled for this, but I couldn't get sufficient results.</p>