installation problem windows 2003 and php 5

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dive_surf

installation problem windows 2003 and php 5

Post by dive_surf »

Please Help Me!

Running
Windows Server 2003
PHP 5.2.2
ImageMagick 6.3.4-10 Q16 Windows Static - Installed to c:\ImageMagick

Gave IUSR account read/execute permissions on c:\ImageMagick
Gave IUSR account read/execute permissions to c:\php\cmd.exe (
I copied c:\windows\system32\cmd.exe to c:\php)

php script (resize.php)
<?php
$cmd = "mogrify -geometry 80x60 C:\Inetpub\intranet\photos\logo.jpg";
exec($cmd);
?>

When the script is executed from the browser the image does not change size. If I call mogrify from the command line with the same parameters it resizes logo.jpg. If I call php from the command line to run resize.php it WILL resize logo.jpg

fyi - I do have php set to display errors and I am not getting any.

I have done many google searches for the past two days in attempts to find what I am missing to no avail.

Bill
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: installation problem windows 2003 and php 5

Post by Bonzo »

I do not know how it is working from the command line but as I see it you do not have an input image and -geometry is not for resizing. I do not Use mogrify so I can not be sure but try:

Code: Select all

<?php
$cmd = "mogrify input.jpg -resize 80x60 C:\Inetpub\intranet\photos\logo.jpg";
exec($cmd);
?>
dive_surf

Re: installation problem windows 2003 and php 5

Post by dive_surf »

The syntax for mogrify is correct, I just confirmed on the imagemagick website.

http://www.imagemagick.com/www/mogrify.html
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: installation problem windows 2003 and php 5

Post by Bonzo »

OK but I think you still need -resize not -geometry.
dive_surf

Re: installation problem windows 2003 and php 5

Post by dive_surf »

I changed my script to use the resize option rather than the geometry option. still no difference unfortunately.

$cmd = "mogrify -resize 80x60 C:\Inetpub\intranet\photos\logo.jpg";
exec($cmd);

I have a feeling its an issue between iis, php, and windows. I just dont know what I am missing. Has anyone else used this combination of software at these version levels?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: installation problem windows 2003 and php 5

Post by Bonzo »

As you say both -resize and -geometry work - I would not have thought they would :shock:

Anyway using a relative path to the image with php5 on my XAMMP server will work so as you say it looks like something to do with windows?
dive_surf

Re: installation problem windows 2003 and php 5

Post by dive_surf »

I am betting the problem is a windows permission issue but I have granted what I believe all the proper permissions. Is there anyone out there that can please help me?
Post Reply