Exec command doesn't work as expected
<p>I'm trying to launch a CLI command from a PHP script:</p>

<p>in particular I wanna use this command <code>convert a.png a.tif</code> to convert an image to tiff.</p>

<p>When I launch this command from CLI it works as expected but if I launch from a PHP script with the following code it doesn't create any tiff image in my folder:</p>

<pre><code>$exec = "convert a.png a.tif";
exec($exec,$yaks,$err);
echo "&lt;pre&gt;";
print_r($yaks);
echo "$err";
echo "&lt;/pre&gt;";
</code></pre>

<p>Moreover <code>$yaks</code> is empty and <code>$err</code> is set to 127.</p>

<p>I'm not an expert, why this doesn't work as expected?</p>

<p>Best regards</p>

<p><strong>UPDATE</strong></p>

<p>I used this command instead <code>$exec = "convert 4.png 4.tif 2&gt;&amp;1";</code> and I got in return <code>[0] =&gt; sh: convert: command not found</code></p>

<p>This seems to me strange since I can use it from CLI!</p>

<p><strong>FINAL UPDATE</strong></p>

<p>Thanks a lot guys!</p>

<pre><code>$exec = "/usr/local/bin/convert a.png a.tif";
</code></pre>

<p>This command solved the problem!
You're great.</p>
