By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,245 Members | 884 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,245 IT Pros & Developers. It's quick & easy.

Win2k CMD.EXE hangs when exec() called

P: n/a
Hi guys,

I'm using ImageMagick to do scaling / filtering to uploaded images by
calling the following:

exec("cmd.exe /c convert.exe -filters in.jpg out.jpg");

This works flawlessly on our developlemt servers, but on our webserver
it'll work for a day or two, then every time exec() is called ImageMagick
runs, does the conversion and terminates (it's removed from the Task
Managers display, out.jpg is saved fine), but CMD.EXE stays resident and
PHP locks up.

Sometimes just restarting IIS is enough to get it going again, but
sometimes the whole machine needs rebooting before exec() will work again
(after that it'll work fine again for a day or two).

calling exec() without calling cmd.exe results in exactly the same thing so
I think PHP runs commands through cmd.exe implicitly.

The version of PHP I'm using is 4.3.8 run using isapi.dll
Has anyone had any experience with this problem, or has any ideas on things
I could try next time it happens?

Regards,
Andrew Crowe
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Tom
Andrew Crowe wrote...
Hi guys,

I'm using ImageMagick to do scaling / filtering to uploaded images by
calling the following:

exec("cmd.exe /c convert.exe -filters in.jpg out.jpg");

This works flawlessly on our developlemt servers, but on our webserver
it'll work for a day or two, then every time exec() is called ImageMagick
runs, does the conversion and terminates (it's removed from the Task
Managers display, out.jpg is saved fine), but CMD.EXE stays resident and
PHP locks up.

Specify the full path?
E:\>which -a convert
e:\WINNT5\system32\convert.exe

E:\>convert /?
Converts FAT volumes to NTFS.

CONVERT volume /FS:NTFS [/V]

volume Specifies the drive letter (followed by a colon),
mount point, or volume name.
/FS:NTFS Specifies that the volume to be converted to NTFS.
/V Specifies that Convert should be run in verbose mode.

E:\>

hth


Jul 17 '05 #2

P: n/a
On Tue, 27 Jul 2004 14:38:36 +0100, "Andrew Crowe" <an************@yahoo.co.uk>
wrote:
I'm using ImageMagick to do scaling / filtering to uploaded images by
calling the following:

exec("cmd.exe /c convert.exe -filters in.jpg out.jpg");


Why are you using cmd.exe instead of just running convert.exe directly?

(I don't tend to use exec() much on Windows so maybe there's some subtlety
here that requires cmd.exe ?)

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #3

P: n/a
I'm using ImageMagick to do scaling / filtering to uploaded images by
calling the following:

exec("cmd.exe /c convert.exe -filters in.jpg out.jpg");

Why are you using cmd.exe instead of just running convert.exe directly?


I've seen other people do it, as I said later in the message
calling exec() without calling cmd.exe results in exactly the same
thing so I think PHP runs commands through cmd.exe implicitly.

Jul 17 '05 #4

P: n/a
No not the system convert function, ImageMagick's convert.exe

At any rate I do call it with the full path "C:\Program
Files\ImageMagic\convert.exe" -filters in.jpg out.jpg, I just thought it
would make the email clearer to leave that bit out (as after all it
worked fine on the dev. server)
Specify the full path?
E:\>which -a convert
e:\WINNT5\system32\convert.exe

E:\>convert /?
Converts FAT volumes to NTFS.

CONVERT volume /FS:NTFS [/V]

volume Specifies the drive letter (followed by a colon),
mount point, or volume name.
/FS:NTFS Specifies that the volume to be converted to NTFS.
/V Specifies that Convert should be run in verbose mode.

E:\>


Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.