467,104 Members | 1,042 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,104 developers. It's quick & easy.

problem running shell executables

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

<?php
$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){
echo("$outputline<br>");
}

?>

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!!
Liam
Jul 17 '05 #1
  • viewed: 1191
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Trevor Fairchild | last post: by
reply views Thread by Gardner Pomper | last post: by
8 posts views Thread by Siemel Naran | last post: by
2 posts views Thread by Xah Lee | last post: by
1 post views Thread by mailpitches@email.com | last post: by
2 posts views Thread by tool@tool.info | last post: by
91 posts views Thread by Eddie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.