Connecting Tech Pros Worldwide Help | Site Map

Win98, PHP, and Imagemagick

Virgil Green
Guest
 
Posts: n/a
#1: Jul 17 '05
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.jpg";

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

$rtn="";
$end=0;

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

echo('$rtn='.$rtn.'<BR>');
echo('$end='.$end.'<BR>');

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


Daniel
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Win98, PHP, and Imagemagick


Hi,

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

I would try $command = "command.com /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.jpg";
>
> $command = "command.com /C convert \"".$file1."\" ".$file2." > NUL";
>
> $rtn="";
> $end=0;
>
> echo $command."<BR>";
> $rtn=system($command, $end);
>
> echo('$rtn='.$rtn.'<BR>');
> echo('$end='.$end.'<BR>');
>
> echo("Conversion Done!<br><img src=gladius.jpg>");
> ?>
> </body>
> </html>
>
>[/color]

Closed Thread