Program behaving differently when started from shell vs PHP's exec()
<p>I seem to have a program [casperjs][1] running properly when typing its command in the shell, </p>

<pre><code>casperjs hello.js
</code></pre>

<p>but not when you use <code>php's exec()</code>:</p>

<pre><code>exec('casperjs hello.js');
</code></pre>

<p>jQuery does not seem to be injected.</p>

<p>Is it possible that there are more <code>putenv()</code> that needs to be defined?</p>

<p><strong>Attempt:</strong> I logged in as the nginx user <code>su www-data</code> and ran the command from shell again and it works fine.</p>
