Processing status...
- Adding iconshirtoff.jpg
Warning: Unable to fork [cmd.exe /c c:Inetpubwwwrootpictureutilnetpbmjpegtopnm --quiet c:Inetpubwwwrootmodulesgalleryalbumsalbum01iconshirtoff.jpg | c:Inetpubwwwrootpictureutilnetpbmpnmfile --quiet --allimages] in c:inetpubwwwrootmodulesgalleryplatformfs_win32.php on line 161
Error: Invalid image: iconshirtoff.jpg!
Need help? Look in the Gallery FAQ
The following is the function the appears to cause the probelm with line 161 being return exec("cmd.exe /c $cmd", $results, $status); Is there a trick to allow this to run in my configuration? Following is code:
----------------------
function fs_exec($cmd, &$results, &$status, $debugfile) {
// We can't redirect stderr with Windows. Hope that we won't need to.
return exec("cmd.exe /c $cmd", $results, $status);
----------------
Hi, I am running
WinXP
IIS 5.1
PHP 4.2.2
Is there something simple I am missing in order to allow the fork Command?
Thanks
Posts: 1
i am having same problem - identical setup. pls help! thanks
Posts: 6
Same issue here, gallery is running fine except for the upload portion.
Been through all the FAQs and searched the forums but none of those suggestions made any difference.
-----------
Windows NT 5.0 build 2195
PHP Version 4.2.2
netPBM v10.6 win32 - libjpeg 6b
Gallery v1.3.1
-----------
When uploading an image I get:
Processing status...
- Adding Sample.jpg
Executing:
c:netpbmbinjpegtopnm C:InetpubWWWrootgalleryalbumsalbum02Sample.jpg | c:netpbmbinpnmfile --allimages
Warning: Unable to fork [cmd.exe /c c:netpbmbinjpegtopnm C:InetpubWWWrootgalleryalbumsalbum02Sample.jpg | c:netpbmbinpnmfile --allimages] in C:InetpubWWWrootgalleryplatformfs_win32.php on line 161
Results:
none
Error messages:
Status: -1 (expected 0)
Error: Invalid image: Sample.jpg!
Need help? Look in the Gallery FAQ
============================
From the command line I type:
C:> C:netpbmbinjpegtopnm.exe c:InetpubSample.jpg | c:netpbmbinpnmfile --allimages
It returns:
C:netpbmbinjpegtopnm.exe: WRITING PPM FILE
stdin: Image 0: PPM raw, 283 by 212 maxval 255
C:>
Any help on this would be appreciated, or else a suggestion of a similar gallery program written for Windows
Thanks
Posts: 487
I did a quick scan of the php site for this error and found this
Not sure if it will help any. This is actually a php error. I also saw mention
that backslashes may need to be escaped under win2k or some such. I don't
have any experience running php or webservers under windows so this is
about the best I can do for you guys. Hopefully something with more knowledge
will pipe up soon. You can also try asking on the php mailing lists for help as it
is a php error.
Posts: 11
Well - that's actually the problem.
You NEED to give the Internet Guest User (IUSR_<yourpcname>) "read & execute" permission on every file you want to execute through the PHP exec() command. As soon as you'll do it for CMD.EXE, Gallery will work fine.
PS:
This has nothing to do with Gallery but is a general (and somehow obvious, although it took me hours to figure out where these "unable to fork" messages came from...) necessity in PHP.
Posts: 2
mhaldima,
Thanks for the heads up but how are Does on assign those rights???
I am using XP IIS, I am unsure how I give the read & execute access.
Thanks
Posts: 6
Well, that's what it was alright. I might have to rethink using "gallery", not sure I want to open up my server that way...
Thanks for the help though, didn't even think of looking at the PHP site. Like I said everything else in gallery was working fine!
Again I really apperciate the help! You Rock :grin:
napalm, setting security settings is both easy, and VERY important. If you're seriously running an IIS webserver on the net without knowing the basic about NTFS security, you might want to make frequent backups. You'll need them eventually!
From Windows explorer right click on the file or folder you want to modify (in this case c:winntsystem32cmd.exe). Select properties. Click on the security tab. That gets you to where you need to be. Acctually knowing what you're doing from there is another thing. :smile: IIS creates a user account based on your computer name. So if your server is named "fooserver" then you should have a user account called IUSR_FOOSERVER. In this case I gave that user read and excute permission and that fixed it. Be careful using "deny" especially in this case.
Hope this helps you
I for one am not in favor of giving anonymous surfers access to my server's command line. :eek:
Posts: 11
Cool you guys got Gallery to work too!
I just wanted to ad a comment to MSboy's security concerns:
You're definitely right, no one likes to give permissions for cmd.exe to unprotected users like the IUSR. But still, as no one will actually SHARE the directory containing CMD.EXE, there's no direct security problem arising from this. What IS important, is that you make sure that your PHP scripts can not be tricked to execute whatever program or code - including cmd.exe - through exec(). This is not particularly difficult though: by not sending any variables (that could be manipulated) to exec() or - if this is absolutely necessary - by at least setting register_globals = off, you sould normally be safe...
Have fun!
Posts: 6
hmmm
i'm using windows 2003
IIS6.0
gave CMD.exe the read & execute permissions in Iusr_win2003
gave the whole dir of c:\IM
also for Iusr_win2003 the read & execute thingies, and now i dont get the fork error no more.. (wich is good :D)...
yet now i still get the....
"Unable to create a zip file from this binary"
i guess security settings for the file aint set correcty then>??
as you can see this is conserning the zip module...
"zip.exe" is located in "e:\cygwin\bin\zip.exe"
any way to get this working??
i'm using gallery2 btw...
ok i think i got the "problem"
all i found in my dir was..
zip.exe
unzip.exe
unzipsfx.ex
yet no zipc.exe...
could any1 send me a download link were i could download it?
thnx