To make Gallery work better under Windows 2k with IIS-5...

Taomyn
Taomyn's picture

Joined: 2003-11-11
Posts: 135
Posted: Tue, 2003-11-11 15:44

Firstly, I'd like to say "Great gallery. Saw it being used at WWDN and decided to use it to replace the photo system I was using before".

Secondly, I had a tough time trying to figure out why I couldn't upload any photos. Found out after some lengthy debugging and tweaks of the code that your use of "CMD.EXE" to call ImageMagick was not working.

By changing the line in function fs_exec in fs_win32.php from:

	return exec("cmd.exe /c \"$cmd\"", $results, $status);

to:

	return exec($cmd, $results, $status);

I was finally able to upload my images - the call to CONVERT.EXE when creating the thumbnails was failing.

This is now exactly the same way my old photo system was calling ImageMagick.

Hope this information is useful to someone,

Cheers,
Taomyn

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Tue, 2003-11-11 18:21

Taomyn, this is pretty interesting. What system are you running? Apache? IIS? OS?

[edit rant]
Slap me, and call me Susan!
I have just proven my stupidity, as I now realize that you gave that info in the topic.

Sorry. :)
[/rant]

 
Taomyn
Taomyn's picture

Joined: 2003-11-11
Posts: 135
Posted: Tue, 2003-11-11 21:42

No problem Susan :-? Full spec:

Win2k Server SP4 + IIS-5
PHP v4.3.4 (via ISAPI in IIS)
MySQL v4.0.16
ImageMagick v5.5.7
JPEGTRAN & JHEAD (downloaded today via your links)

I've now upgraded to 1.4.1 RC2 as I thought "what the hell, I've only just started", and I am struggling with a few things. I do love the new skins though - classy.

Yes, it has the same EXEC problem which I sorted again, but as well as the problem I reported in the comments for RC2 on your front page (single photo upload not working), I'm now having huge problems trying to upload MOV files from my camera (one of the main reasons I want to switch to Gallery).

At first it was just too much data, 6 files each over 3.5Mb in size, but when I tried just a couple, Gallery seemed to go off into oblivion then just returned "page not found". I did notice at one point that it was unable to resize the image - isn't that a bit obvious seeing as it's a movie file? When I tried just one, I got:

- Adding P6210021.MOV 
   Resizing/compressing original image 
Cannot resize/compress this filetype 
Warning: filemtime(): Stat failed for D:/wwwroot/gallery/albums/Dukes_Birthday_2003/P6210021.mov (errno=2 - No such file or directory) in D:\wwwroot\gallery\util.php on line 1460

Another issue I had during the upgrade. The configurator insisted I needed .htaccess file even though it was optional last version, and I'm not running Apache. I copied the one that's in the setup folder and cleared it out, and that let it get passed this minor annoyance. Correct me if I'm being daft, but why can't the configurator create these files if they are missing? Of course it shouldn't create a .htaccess in my case.

Sorry to say this, :( ,but an RC release this is not. A late beta would be more accurate.

One last thing. Any chance of making the user-id case-insensitive. It's more the norm these days and people who will access my site will only complain.

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Tue, 2003-11-11 21:55

Taomyn,
first of all the problem with filesizes might be php related, not Gallery related. Check if some of the things in FAQ Gallery:c.6

secondly, the .htaccess check. I'll have a word with the developers on that one.

Thirdly, case-insensitivity is comming AFAIK, probably in 1.4.2.

Sorry that you are having problems, but remember that IIS isn't really supported at all. But, your feedback on the exec() calls might ease things in a later release.

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Wed, 2003-11-12 02:23

h0bbel, DUH, someone can't read :-P (insideish joke)

 
Taomyn
Taomyn's picture

Joined: 2003-11-11
Posts: 135
Posted: Wed, 2003-11-12 07:28

h0bbel,

Thanks for advice. I suspected the limit was more with PHP but I'm happy with that seeing as I really don't want people sucking away my meagre bandwidth uploading their latest "wedding videos" etc

The problem I'm getting is what Gallery then does with the .MOV afterwards as shown in my example text from the status screen. It's not quite right :-?

Oh, if there's a list of frequently asked Windows questions about anywhere, point me at it and I'll see if any of them ring a bell. I've been using IIS+PHP+MySQL for nearly three years and hit most sorts of PHP problems in that time. Happy to help if I can,

Taomyn

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Wed, 2003-11-12 07:33

Taomyn, i'll have the devs look at your debug info. But any help you can provide with running Gallery on IIS is really appreciated.

 
Taomyn
Taomyn's picture

Joined: 2003-11-11
Posts: 135
Posted: Fri, 2003-12-12 13:55

Looks like one problem with Gallery under Windows IIS is that all command execution done by PHP uses CMD.EXE, that's why when using the standard Gallery code you get multiple CMD.EXEs appearing. Although I hadn't seen any problems in weeks, it all of a sudden started happening on my system.

I have submitted a bug report for a change request to PHP.NET (http://bugs.php.net/bug.php?id=26566) asking them for a non-CMD.EXE option, so if anyone here would like to see this issue fixed, please follow the link and rate/vote for it.

Also, it seems using the ISAPI module seems to make the problem worse (v4.3.4 of PHP), so I've configured IIS to use PHP.EXE for Gallery and haven't seen things go wrong since. However, there's a tiny performance hit when using the EXE over the ISAPI dll.

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Fri, 2003-12-12 14:30

Taomyn, i'll talk a bit with the devs, we might be able to rip out the cmd.exe that Gallery does, in 1.4.3.

Thanks for your continued investigations. :)

 
raventures
raventures's picture

Joined: 2003-09-19
Posts: 30
Posted: Sat, 2004-01-31 21:10

I have made your suggested change to fs_win32.php and still get:

Line: 31
Char: 1
Error: Permission Denied
Code:0
URL: (http://my local dev server path here)/gallery/add_photo.php

- Adding n185rabeach.jpg
Resizing/compressing original image
No resizing required
Warning: exec(): Unable to fork [c:\ImageMagick\convert -quality 60 -size 150x150 +profile '*' c:\inetpub\wwwroot\skywagons\gallery\albums\fly_ins\n185rabeach.jpg -geometry 150x150 c:\inetpub\wwwroot\skywagons\gallery\albums\fly_ins\n185rabeach.thumb.jpg] in c:\inetpub\wwwroot\skywagons\gallery\platform\fs_win32.php on line 171

Error: Unable to make thumbnail (0)!
Need help? Look in the Gallery FAQ

Using Gallery v1.4.1-pl1, WinXP Pro, IIS 5 on development server.

I have Gallery v1.3.4 running properly on the Win2K public production server, and went to build an internal testing server up, but ran into this snafu when trying to upload images. The production Win2K server has "Security" ->"Everyone" r/w/x (IIS equiv of "global r/w/x"), but XP does not have the "Security" tab seen on Win2K.

I have also tried setting the WinXP "Web Sharing" to "Shared" w/ r/w/x perms, but same error. Both servers use a C:\ImageMagick physical folder and Galley configured identically in this area.

Ideas?

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Sat, 2004-01-31 21:22

raventures, exec(): Unable to fork seems to indicate some problems executing cmd.exe at all. Did you try copying it to the php install dir, as mentioned in the docs?

As for the security tab, if you're running XP Pro, you must open Windows Explorer, go to Tools, Folder Options, View and uncheck Use Simple File Sharing. :)

 
Taomyn
Taomyn's picture

Joined: 2003-11-11
Posts: 135
Posted: Sat, 2004-01-31 23:59
h0bbel wrote:
raventures, exec(): Unable to fork seems to indicate some problems executing cmd.exe at all. Did you try copying it to the php install dir, as mentioned in the docs?

As for the security tab, if you're running XP Pro, you must open Windows Explorer, go to Tools, Folder Options, View and uncheck Use Simple File Sharing. :)

Shouldn't be any need to copy CMD.EXE so long as you give whatever account IIS v5.1 is using to run it the correct access, i.e. read & execute only. Note I say IIS v5.1 as it's not the same as Win2k (v5) or Win2k3 (v6) so this could be a whole new ball game (who knows what Microsoft changed for XP).

The suggestion about the switching off "Simple File" sharing is a good start, and also get hold of Process Explorer from www.sysinternals.com and use it to monitor what's running. If you set the refresh to 0.5 seconds and the closed task persistance to 2+ seconds you should see the processes being executed and what account it's using (if it says ACCESS DENIED for the user, try again as this means it wasn't quick enough to get the user-id before the task stopped).

Taomyn.

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Sun, 2004-02-01 00:07

Taomyn, great stuff. We need you around. :)

 
zdog18

Joined: 2004-03-31
Posts: 3
Posted: Wed, 2004-03-31 20:43

I did the "copy cmd.exe to a different directory" step and it actually worked for me. I'm using Win2k Server with IIS 5 and I kept getting "Unable to fork" errors. I gave the IIS guest user and even "Everyone" full access to "cmd.exe" to try to get it to work and it didn't help. I moved "cmd.exe" to the C:\PHP\ directory and gave the IIS user full access to it and it worked perfectly. I'm not sure why, but it did. Hopefully this will be helpful to someone. :D

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Wed, 2004-03-31 23:49

zdog18, it does. And, it's in the docs. :)