problem running shell executables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • LRW

    problem running shell executables

    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("$outputli ne<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
Working...