Win98, PHP, and Imagemagick

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

    Win98, PHP, and Imagemagick

    I've been fighting with this for three days. Can anyone give me a clue as to
    what I need to do to make this script work?

    Win98 (first edition), PHP 4.3.3, Imagemagick 5.5.7 Q8, PWS 4.0

    If the line with the system(...) call is removed, the script runs as
    expected. Otherwise, the command is executed and the image conversion is
    done successfully, but no response is returned from the server. After that,
    no more pages will be served and a reboot is required.

    What you see below is the result of hours of Googling and experimentation .
    I'm finally breaking down and asking.

    - Virgil

    testmagic.php
    ===========
    <html>
    <body>
    <?php

    $file1 = "LOGO:";
    $file2 = "gladius.jp g";

    $command = "command.co m /C convert \"".$file1." \" ".$file2." > NUL";

    $rtn="";
    $end=0;

    echo $command."<BR>" ;
    $rtn=system($co mmand, $end);

    echo('$rtn='.$r tn.'<BR>');
    echo('$end='.$e nd.'<BR>');

    echo("Conversio n Done!<br><img src=gladius.jpg >");
    ?>
    </body>
    </html>


  • Daniel

    #2
    Re: Win98, PHP, and Imagemagick

    Hi,

    Your $command instruction scares me! There are a lot of unescaped "....

    I would try $command = "command.co m /C convert \"$file1\" \"$file2\" > NUL";

    Also, "logo:" is not a valid filename for Windows AFAIK ( ":" is a
    reserved character along with \/*?

    Cordially,
    Daniel

    Virgil Green wrote:
    [color=blue]
    > I've been fighting with this for three days. Can anyone give me a clue as to
    > what I need to do to make this script work?
    >
    > Win98 (first edition), PHP 4.3.3, Imagemagick 5.5.7 Q8, PWS 4.0
    >
    > If the line with the system(...) call is removed, the script runs as
    > expected. Otherwise, the command is executed and the image conversion is
    > done successfully, but no response is returned from the server. After that,
    > no more pages will be served and a reboot is required.
    >
    > What you see below is the result of hours of Googling and experimentation .
    > I'm finally breaking down and asking.
    >
    > - Virgil
    >
    > testmagic.php
    > ===========
    > <html>
    > <body>
    > <?php
    >
    > $file1 = "LOGO:";
    > $file2 = "gladius.jp g";
    >
    > $command = "command.co m /C convert \"".$file1." \" ".$file2." > NUL";
    >
    > $rtn="";
    > $end=0;
    >
    > echo $command."<BR>" ;
    > $rtn=system($co mmand, $end);
    >
    > echo('$rtn='.$r tn.'<BR>');
    > echo('$end='.$e nd.'<BR>');
    >
    > echo("Conversio n Done!<br><img src=gladius.jpg >");
    > ?>
    > </body>
    > </html>
    >
    >[/color]

    Comment

    Working...