By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,723 Members | 1,876 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,723 IT Pros & Developers. It's quick & easy.

problem running shell executables

P: n/a
I'm using a PHP script to run some command line...commands, and they
seem to half work.
Here's what I have:

$mog = escapeshellcmd("/usr/bin/mogrify -size 180x180 -colorspace RGB
+profile \"*\" /usr/shipthumbs/*.tif");
$mont = escapeshellcmd("/usr/bin/montage -tile 4x4 -colorspace RGB
-label \"%f\" -resize 180x180 -geometry 180x180+0+0 -gravity South
/usr/shipthumbs/*.* /usr/shipthumbs/montage.png");
$del_t = escapeshellcmd("/bin/rm -f /usr/shipthumbs/*.tif");
$del_e = escapeshellcmd("/bin/rm -f /usr/shipthumbs/*.eps");

exec("$mog 2>&1", $output);
echo $output;
exec("$mont 2>&1", $output);
echo $output;
exec("$del_t 2>&1", $output);
echo $output;
exec("$del_e 2>&1", $output);
echo $output;
echo "Completed.";
foreach($output as $outputline){


I know the first command, $mog, is working fine. And the 2nd one $mont
tries because it runs for a LONG time before I finally get the
response back that it's complete.
Yet, the file montage creates doesn't get created and the files don't
get deleted, and there's no echo of an error.

I know the montage line works because it works fine when I run it in a
bash shell. And the remove lines are simple. And I know the error
reporting works, because when I didn't have appropriate permissions on
the directory the echoes were coming back with permission errors on
the montage and the removes.
So, I know it's trying, but after the mogrify it thinks it's done the
job but hasn't.

Am I missing something here? Is there another part of exec I don't
know about and am missing in the man?

Thanks for any suggestions!!
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.