[SOLVED] ImageMagick, Unzip binaries path help...

zirzlo

Joined: 2005-04-30
Posts: 8
Posted: Sat, 2005-04-30 18:50

Hello everyone,

Well, I'm stumped. I've read through every post here related to this problem, but I simply cannot get G2 to work with the ImageMagick binaries or Unzip. Here is some background info:

Windows 2003 Server
IIS 6
PHP 5.04
MySQL 4.1.11
ImageMagick 6.2.2
Info-Zip Unzip 5.52

Also, FYI, this all works fine with G1.

So, first with ImageMagick, on the config screen it asks for a path to the binaries. I enter C:\ImageMagick\ Then I click on the Test Settings button and each of the four binaries fail and the debug output is:

==================
is_dir(c:\ImageMagick\)
getcwd()
chdir(d:\data\albums2\tmp\)
file_exists(c:\ImageMagick\gm)
file_exists(c:\ImageMagick\identify.exe)
Executing: cmd /c " "c:\ImageMagick\identify"
"c:\Inetpub\wwwroot\gallery2\modules\imagemagick\classes\..\test\data\test.gif"
2> "d:\data\albums2\tmp\g2d495.tmp" "
file_exists(d:\data\albums2\tmp\g2d495.tmp)
filesize(d:\data\albums2\tmp\g2d495.tmp)
unlink(d:\data\albums2\tmp\g2d495.tmp)
Regular Output:
Error Output:
Status: 1 (expected 0)
file_exists(c:\ImageMagick\gm)
tempnam(d:\data\albums2\tmp\, imgk_)
file_exists(c:\ImageMagick\convert.exe)
Executing: cmd /c " "c:\ImageMagick\convert" "-size" "200x200"
"-geometry" "200x200"
"c:\Inetpub\wwwroot\gallery2\modules\imagemagick\classes\..\test\data\test.gif"
"d:\data\albums2\tmp\img496.tmp" 2> "d:\data\albums2\tmp\g2d497.tmp" "
file_exists(d:\data\albums2\tmp\g2d497.tmp)
filesize(d:\data\albums2\tmp\g2d497.tmp)
unlink(d:\data\albums2\tmp\g2d497.tmp)
Regular Output:
Error Output:
Status: 1 (expected 0)
unlink(d:\data\albums2\tmp\img496.tmp)
file_exists(c:\ImageMagick\gm)
file_exists(c:\ImageMagick\combine)
file_exists(c:\ImageMagick\composite)
file_exists(c:\ImageMagick\gm)
tempnam(d:\data\albums2\tmp\, imgk_)
Executing: cmd /c " "c:\ImageMagick\composite" "-geometry" "+0+0"
"c:\Inetpub\wwwroot\gallery2\modules\imagemagick\classes\..\test\data\test.jpg"
"c:\Inetpub\wwwroot\gallery2\modules\imagemagick\classes\..\test\data\test.gif"
"d:\data\albums2\tmp\img498.tmp" 2> "d:\data\albums2\tmp\g2d499.tmp" "
file_exists(d:\data\albums2\tmp\g2d499.tmp)
filesize(d:\data\albums2\tmp\g2d499.tmp)
unlink(d:\data\albums2\tmp\g2d499.tmp)
Regular Output:
Error Output:
Status: 1 (expected 0)
file_exists(d:\data\albums2\tmp\img498.tmp)
unlink(d:\data\albums2\tmp\img498.tmp)
chdir(c:\Inetpub\wwwroot\gallery2)
====================

So I open a command prompt and try running by hand the first of the four tests just to see what happens and everything appears to work fine. For example I run:

cmd /c " "c:\ImageMagick\identify" "c:\Inetpub\wwwroot\gallery2\modules\imagemagick\classes\..\test\data\test.gif" 2> "d:\data\albums2\tmp\g2d495.tmp" "

and get:

c:\Inetpub\wwwroot\gallery2\modules\imagemagick\classes\..\test\data\test.gif GIF 50x50 50x50+0+0 PseudoClass 8c 232

Does that mean it worked from the command line??

Now, Unzip. I enter the path c:\ImageMagick\utils\ and it says, "The path you entered isn't a valid path to an unzip binary." So then I explicity point it to the binary itself, specifying c:\ImageMagick\utils\unzip.exe and it says, "The path you entered doesn't contain a valid unzip binary." BUT, it at least runs the test, but fails.

So, through my own experience with G1 and reading through the posts here, I have made sure that the c:\ImageMagick directory and sub-directories have RWX for the internet user. Made sure CMD.EXE has RWX for the internet user. Heck, I've even given Everyone Full Control to the programs and directories involved, all to no avail. So, I don't think it is a permissions problem. That said, I'm at a loss if it isn't permissions. I don't know what else to look at. Everything seems to work fine from a command line.

Any ideas?

Thanks!

----

Gallery version: G2B2
Webserver (with version):IIS 6
Datatabase (with version):MySQL 4.1.11
PHP version (eg 4.2.1):5.04
Graphics Toolkit(s):ImageMagick 6.2.2
Operating system:Windows Server 2003
Web browser/version:IE 6.x

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Sat, 2005-04-30 23:47

zirzlo, is cmd.exe authorized in IIS? Also, have you given the Networking Service permissions to cmd.exe?

 
zirzlo

Joined: 2005-04-30
Posts: 8
Posted: Sun, 2005-05-01 01:56

h0bbel, I hadn't given Network Service permissions to cmd.exe. I tried it, but that didn't seem to help, unfortunately.

As to '..is cmd.exe authorized in IIS?' Could you expand on that in a little more detail please? I have tried giving the following users full control rights to cmd.exe, all to no avail: IUSR_OTTO, IWAM_OTTO, IIS_WPG, & Network Service. Is there something in the IIS config I'm missing?

Thanks.

 
zirzlo

Joined: 2005-04-30
Posts: 8
Posted: Mon, 2005-05-02 06:03

well, i went and did a complete reinstall of everything (g2, mysql, php, imagemagick, zip, unzip, iis) same problem. also of note, this happens for any module where i have to specify a path. i'll keep digging......

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Mon, 2005-05-02 08:56

This is a really, really dumb question... but have you tried with a path like "c:/windows" instead of "c:\windows" (or visa versa, depending on what you use now?). If that fixes it, i'll eat a bowl of jello.

I also don't know what he means by authorizing iis to use cmd.exe. In linux, you can do "su - apache" which changes you to the apache user. You can then try to run any command you want and if it WORKS, then apache can do the same. If it can't, then apache can't. Can you log into winblows as "IUSER_OMGWTFISTHISSTUFFHERE"?

 
buut
buut's picture

Joined: 2003-06-18
Posts: 196
Posted: Mon, 2005-05-02 12:38

zirzlo,
Did you read the FAQ http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=21599&start=0&sid=ffbcd97887db24d37ee619d2d25286b3 already?

Just look for the question:
I get lots of "Warning: exec(): Unable to fork [cmd /c ...]" at the module's step in the installer for G2 (on the ImageMagick module) under Windows/IIS. Now what?

This might help you

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Mon, 2005-05-02 16:03

fryfrog, logging in with the IIS user, is impossible, since you don't know it's pw. :-) Just for the record.

 
zirzlo

Joined: 2005-04-30
Posts: 8
Posted: Mon, 2005-05-02 22:04

fryfrog, yes, i've tried just about every combination of entering the path that i could imagine, all with the same results.

buut, thanks, that is what h0bbel was referring to in asking about rights assignments for the iusr_xxx account on cmd.exe.

although you don't know the password of the iusr_xxx account, you can create a new account and tell iis to use that account. i'll have to try that when i get home.

thanks for the idea!

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Mon, 2005-05-02 22:09

zirzlo, that is a possiblity, yes. :)

 
zirzlo

Joined: 2005-04-30
Posts: 8
Posted: Tue, 2005-05-03 02:49

aaarrgghh.....

i give up...

i created a new user account to use instead of iusr_xxx. same results.

i just don't understand why it fails on the config screen, but if i copy/paste the command it is trying to run to a command prompt and run it manually, it seems to run fine. mind you this is even with the new user id created which has the same restrictions as the iusr account.

grrrrr....it must be something simple.....

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Tue, 2005-05-03 17:01

Try running filemon ( http://www.sysinternals.com/ntw2k/source/filemon.shtml ) and then upload. It might help you determine the cause of this.

 
zirzlo

Joined: 2005-04-30
Posts: 8
Posted: Thu, 2005-05-05 20:27

h0bbel, THANK YOU!! That was the perfect suggestion. Everything is working now.

I'll post back with more detailed information about how after I nail down the exact rights issues, but the quick fix was to make sure NETWORK SERVICE also had RWX on the albums folder.

Stay tuned....

 
YAFA

Joined: 2006-01-12
Posts: 10
Posted: Sat, 2006-09-30 14:37

Hey boys,

I don't really know, why I didn't see this thread on one of my approaches to solve this DAMN F*#KING problem. I tried a lot, did the whole Win/IIS-FAQ and it didn't work. The NEWORK SERVICE-hint is it, my gallery2-installations work with full features again... 9 months after moving from a virtual webhost onto an own server.

Thx a lot.

GTX, Felix
---
YAFA - Yet Another Forum Account

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2006-09-30 14:58

Could you guys please add these notes to the Windows / IIS guide on codex.gallery2.org?

 
Osivert

Joined: 2006-12-06
Posts: 1
Posted: Wed, 2006-12-06 21:39

Zirzlo....Thank YOU! This worked for me as well...fixed my imagemagick and zip binary problems. Quick question though, does giving IUSER and Network Service permissions to run cmd.exe cause any security issues?