Creating a tgz file through PHP exec()
<p>I'm trying to create a .tgz file through the PHP exec(); function in an AJAX web interface, however, my code isn't making any files, and it isn't writing out any errors. </p>

<p>This code works in shell: </p>

<pre><code>tar cvfz destination/testfolder.tgz source/testfolder
</code></pre>

<p>I'm setting the <code>destination/testfolder.tgz</code> and the <code>source/testfolder</code> as variables in PHP since they change based on user input, so my code looks something like this:</p>

<pre><code>$q=$_GET["q"];
$part = explode("/", $q);
$source = $q;
$dest = "destination/" .$part[1].".tgz";
exec("tar cvfz " . $dest . " " . $source);
</code></pre>

<p>I've echoed the <code>"tar cvfz " . $dest . " " . $source</code> and copy/pasted it into shell, which works, so I'm confused as to what I'm doing wrong. </p>
