Here is my code:
$pdf = '/Users/macbookpro/Desktop/q.pdf';
$swf = '/Users/macbookpro/Desktop/q.swf';
$command2 = 'pdf2swf -o '.$swf.' -T -z -t -f '.$pdf.' -s flashversion=9';
exec($command2,$out,$status);
var_dump($output);
The output is NULL and no SWF is generated. However, if I output the command and copy it to terminal, it works. How do I solve this?
exec runs as the user running the script. Apache user likely doesn't have the PATH variable telling it where to look for programs, so instead of
Try adding the location of pdf2swf, something like:
And make sure that the apache user has permission to get to the executable, and permission to execute it.
Of course replace
/bin/with where ever pdf2swf really lives for all the example code in this answer.