473,405 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Win2k CMD.EXE hangs when exec() called

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
4 5490
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: WebScott | last post by:
I am trying to run GnuPG encrypt and decrypt functions from a PHP script on a Win2k machine. I have tried several variations to no avail. Basically what I want to be able to do is something like...
12
by: JD | last post by:
This is another Python problem, I think might be unrelated to the earlier bug I found, and eventually figured out how to report it to Sourceforge. This is related to a question I have about...
2
by: Tam | last post by:
Hi, I am new to Win2k and SQL server and need to back up everything each night. I used the supplied NT backup utility to schedule a backup but this missed some files that were open or in use. I...
1
by: szudor | last post by:
Hi, When I start db2cc, the program hangs with memory access violation in javaw.exe. Strating with trace option, in java trace file I found the following information: 0SECTION TITLE...
1
by: Serge | last post by:
Hi, I am having some lock up problems in my c# code. when from a 2nd thread (worker thread) i call a normal standard function like Trace.WriteLine the 2nd thread freezes/hangs. The 2nd thread...
6
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a...
0
by: Pedro Bautista | last post by:
Status: Unsolved and puzzling Steps to reproduce the error: 1.- Delete IUSER from server 2.- Reboot server (OS rebuilds IUSR) 3.- Assign IUSR read and execute permission on web folder and...
9
by: a | last post by:
I already posted on this subject, but I have some more information that should make the issue clearer. Config: Apache 2.x, PHP 5.1.x, Windows XP Pro A php script processes a form. Inside this...
3
by: Fiddler2 | last post by:
I noticed that after running compact/repair, I have to recompile my code for the program not to break the next time I open it. What happens is the auto exec macro runs the main() module, then hangs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.