Problem getting imagemagick to work with php...
| From: | Brian Aitken | Date: | Tue, 30 Oct 2001 16:05:42 +0000 |
| Subject: | Problem getting imagemagick to work with php... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-72894@lists.php.net to get a copy of this message | ||
Hiya
I need to be able to automatically change the format and size of an image
when a user uploads it and using imagemagick's tools seems like the way to
go about it.
Unfortunately the server I'm using is Windows based and it doesn't have
imagemagick installed. I downloaded the Windows imagemagick binaries and
the tools work fine locally from the dos prompt.
I hoped that uploading these files to a directory on the server would allow
my PHP script to use the tools, but either I'm typing in the wrong commands
or the tools won't work on the server.
When I try this little test script:
*****
$file1 = "\\images\\gladius.tiff";
$file2 = "\\images\\gladius.jpg";
$command = "\\imagemagick\\convert ".$file1." ".$file2;
$result = system($command);
if ($result)
{
echo("Conversion Done!<br><img src = gladius.jpg>");
}
*****
I get:
Warning: Unable to fork [\imagemagick\convert \images\gladius.tiff
\images\gladius.jpg] in ....
I've tried using unix slashes and single slashes. I've also tried running
the script in the imagemagick directory - I didn't get the 'fork' error but
the system function returned false. I also tried using exec(), passthru()
and backticks but none of them worked (backticks gave a weird CGI error
message).
Anyone know what I'm doing wrong? Does Imagemagick need to be installed in
some special place on the server?
Thanks
Brian