An Unhandled Win32 Exception Occurred When Executing PHP FromWindows

An Unhandled Win32 Exception Occurred When Executing PHP FromWindows

am 31.10.2008 13:25:27 von Alice Wei

--_2635edee-007f-4162-b8aa-6e560320aeb6_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

I have been looking around for documents on http://www.microsoft.com on t=
he generation of win32 exception errors=2C but I am not exactly sure what=20
steps I should take when the debugger is triggered by either a Shockwave fi=
le application=2C or from an HTTP Request.=20

Here is the code snippet:

//execute program
shell_exec("C:\Inetpub\wwwroot\incidence\my-manager.exe -d$date -p$event"=
)=3B
=20
=20
When I run the code as embedded in PHP=2C I see a pop up window with the fo=
llowing words: An unhandled win32 exception occurred in my-manager.exe [237=
2].
However=2C when I only run the application using cmd=2C it does not give me=
any errors.=20

Is there something I should try that I have not?

Thanks in advance.
=0A=
=0A=
=0A=
=0A=

____________________________________________________________ _____
Search from any Web page with powerful protection. Get the FREE Windows Liv=
e Toolbar Today!
http://get.live.com/toolbar/overview=

--_2635edee-007f-4162-b8aa-6e560320aeb6_--

Re: An Unhandled Win32 Exception Occurred When Executing PHP From Windows

am 31.10.2008 13:35:43 von Stut

On 31 Oct 2008, at 12:25, Alice Wei wrote:
> I have been looking around for documents on http://
> www.microsoft.com on the generation of win32 exception errors, but I
> am not exactly sure what
> steps I should take when the debugger is triggered by either a
> Shockwave file application, or from an HTTP Request.
>
> Here is the code snippet:
>
> //execute program
> shell_exec("C:\Inetpub\wwwroot\incidence\my-manager.exe -d$date -p
> $event");
>
>
> When I run the code as embedded in PHP, I see a pop up window with
> the following words: An unhandled win32 exception occurred in my-
> manager.exe [2372].
> However, when I only run the application using cmd, it does not give
> me any errors.
>
> Is there something I should try that I have not?

This is almost certainly due to something that exe file is trying to
use and nothing at all to do with PHP. What does my-manager.exe do?

-Stut

--
http://stut.net/

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: An Unhandled Win32 Exception Occurred When ExecutingPHP From Windows

am 31.10.2008 13:41:31 von Alice Wei

--_c9322b8e-e47f-4920-946b-33b29d194434_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,
To answer your question=2C the exe file is written in C and creates seve=
ral output files that calculates various variables based on the user input =
(which the PHP handles).=20
What I am surprised about is that when I run the exe file by itself=2C =
there is no error at all. However=2C once I use PHP to "call" the file=2C i=
t does not crash=2C but I have to click No when it executes to allow the pr=
ogram to proceed. I tried to follow the instructions from the document in t=
he url below=2C but I could not find the files=2C and I was not sure if tha=
t really is the cause of the interruptions of my program.=20
Does this give you more information in helping me solve my problem?

Thanks in advance.

Alice
> CC: php-windows@lists.php.net
> From: stuttle@gmail.com
> To: ajwei@alumni.iu.edu
> Date: Fri=2C 31 Oct 2008 12:35:43 +0000
> Subject: Re: [PHP-WIN] An Unhandled Win32 Exception Occurred When Executi=
ng PHP From Windows
>=20
> On 31 Oct 2008=2C at 12:25=2C Alice Wei wrote:
> > I have been looking around for documents on http://=20
> > www.microsoft.com on the generation of win32 exception errors=2C but I =
=20
> > am not exactly sure what
> > steps I should take when the debugger is triggered by either a =20
> > Shockwave file application=2C or from an HTTP Request.
> >
> > Here is the code snippet:
> >
> > //execute program
> > shell_exec("C:\Inetpub\wwwroot\incidence\my-manager.exe -d$date -p=20
> > $event")=3B
> >
> >
> > When I run the code as embedded in PHP=2C I see a pop up window with =20
> > the following words: An unhandled win32 exception occurred in my-=20
> > manager.exe [2372].
> > However=2C when I only run the application using cmd=2C it does not giv=
e =20
> > me any errors.
> >
> > Is there something I should try that I have not?
>=20
> This is almost certainly due to something that exe file is trying to =20
> use and nothing at all to do with PHP. What does my-manager.exe do?
>=20
> -Stut
>=20
> --=20
> http://stut.net/
>=20
> --=20
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe=2C visit: http://www.php.net/unsub.php
>=20

____________________________________________________________ _____
Express yourself with gadgets on Windows Live Spaces
http://discoverspaces.live.com?source=3Dhmtag1&loc=3Dus=

--_c9322b8e-e47f-4920-946b-33b29d194434_--

Re: An Unhandled Win32 Exception Occurred When ExecutingPHP From Windows

am 31.10.2008 14:05:31 von Alf C Stockton

Alice Wei wrote:
> Hi,
> To answer your question, the exe file is written in C and creates several output files that calculates various variables based on the user input (which the PHP handles).
> What I am surprised about is that when I run the exe file by itself, there is no error at all. However, once I use PHP to "call" the file, it does not crash, but I have to click No when it executes to allow the program to proceed. I tried to follow the instructions from the document in the url below, but I could not find the files, and I was not sure if that really is the cause of the interruptions of my program.
> Does this give you more information in helping me solve my problem?
>
> Thanks in advance.
Do you have the source of the exe? Is it C or C++ or C#?

--
Regards,
Alf Stockton www.stockton.co.za

Courage is your greatest present need.

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: An Unhandled Win32 Exception Occurred When ExecutingPHP From Windows

am 31.10.2008 14:17:00 von Alice Wei

--_1961df06-4c35-47f0-8162-dd4aff975dc3_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

>=20
> Alice Wei wrote:
> > Hi,
>=0A=
> To answer your question=2C the exe file is written in C and creates=0A=
several output files that calculates various variables based on the=0A=
user input (which the PHP handles).=20
> > What I am surprised=0A=
about is that when I run the exe file by itself=2C there is no error at=0A=
all. However=2C once I use PHP to "call" the file=2C it does not crash=2C b=
ut=0A=
I have to click No when it executes to allow the program to proceed. I=0A=
tried to follow the instructions from the document in the url below, =
but I could not find the files=2C and I was not sure if that really is=0A=
the cause of the interruptions of my program.=20
> > Does this give you more information in helping me solve my problem?
> >=20
> > Thanks in advance.
> Do you have the source of the exe? Is it C or C++ or C#?

The=0A=
exe file is written in C=2C but I don't have the source file of it=2C since=
=0A=
my client wanted me to execute it using that to prevent my having to=0A=
execute several codes.=20
I have just tried using command prompt to=0A=
execute the command below=2C and there were no errors=2C and no Visual=0A=
Studio Just In-Time Debugger pop up boxes generated.
my-manager.exe -d24 -p20

Do I have to install Visual Studio on the machine of where my PHP is execut=
ing this exe file?

Thanks in advance.

Alice


> --=20
> Regards=2C
> Alf Stockton www.stockton.co.za
>=20
> Courage is your greatest present need.
>=20
> --=20
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe=2C visit: http://www.php.net/unsub.php
>=20

____________________________________________________________ _____
All-in-one security and maintenance for your PC.=A0 Get a free 90-day trial=
!
http://www.windowsonecare.com/purchase/trial.aspx?sc_cid=3Dw l_wlmail=

--_1961df06-4c35-47f0-8162-dd4aff975dc3_--

Re: An Unhandled Win32 Exception Occurred When ExecutingPHP From Windows

am 31.10.2008 14:43:06 von Alf C Stockton

Alice Wei wrote:
>> Alice Wei wrote:
>>> Hi,
>> To answer your question, the exe file is written in C and creates
> several output files that calculates various variables based on the
> user input (which the PHP handles).
>>> What I am surprised
> about is that when I run the exe file by itself, there is no error at
> all. However, once I use PHP to "call" the file, it does not crash, but
> I have to click No when it executes to allow the program to proceed. I
> tried to follow the instructions from the document in the url below,
> but I could not find the files, and I was not sure if that really is
> the cause of the interruptions of my program.
>>> Does this give you more information in helping me solve my problem?
>>>
>>> Thanks in advance.
>> Do you have the source of the exe? Is it C or C++ or C#?
>
> The
> exe file is written in C, but I don't have the source file of it, since
> my client wanted me to execute it using that to prevent my having to
> execute several codes.
> I have just tried using command prompt to
> execute the command below, and there were no errors, and no Visual
> Studio Just In-Time Debugger pop up boxes generated.
> my-manager.exe -d24 -p20
>
> Do I have to install Visual Studio on the machine of where my PHP is executing this exe file?
>
I do not believe that that would make much difference.

--
Regards,
Alf Stockton www.stockton.co.za

You could live a better life, if you had a better mind and a better body.

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: An Unhandled Win32 Exception Occurred When ExecutingPHP From Windows

am 31.10.2008 14:51:21 von Alice Wei

--_270610ee-55c6-4f38-828e-2ce211f60e2d_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Hi=2C Al and those who have replied:

I think I am still in midst of this mystery=2C but it looks like that thi=
s error is triggered when I am trying to run this PHP code with the lines I=
have posted from a Shockwave file application.=20
When I only have the PHP with the shell_exec command=2C it is not giving =
me any errors.=20

You are right=2C my errors do not come from PHP this time.=20

Alice

> Date: Fri=2C 31 Oct 2008 15:43:06 +0200
> From: alf@stockton.co.za
> To: php-windows@lists.php.net
> CC: ajwei@alumni.iu.edu
> Subject: Re: [PHP-WIN] An Unhandled Win32 Exception Occurred When Executi=
ng PHP From Windows
>=20
> Alice Wei wrote:
> >> Alice Wei wrote:
> >>> Hi,
> >> To answer your question=2C the exe file is written in C and creates
> > several output files that calculates various variables based on the
> > user input (which the PHP handles).=20
> >>> What I am surprised
> > about is that when I run the exe file by itself=2C there is no error at
> > all. However=2C once I use PHP to "call" the file=2C it does not crash=
=2C but
> > I have to click No when it executes to allow the program to proceed. I
> > tried to follow the instructions from the document in the url below=2C
> > but I could not find the files=2C and I was not sure if that really is
> > the cause of the interruptions of my program.=20
> >>> Does this give you more information in helping me solve my proble=
m?
> >>>
> >>> Thanks in advance.
> >> Do you have the source of the exe? Is it C or C++ or C#?
> >=20
> > The
> > exe file is written in C=2C but I don't have the source file of it=2C s=
ince
> > my client wanted me to execute it using that to prevent my having to
> > execute several codes.=20
> > I have just tried using command prompt to
> > execute the command below=2C and there were no errors=2C and no Visual
> > Studio Just In-Time Debugger pop up boxes generated.
> > my-manager.exe -d24 -p20
> >=20
> > Do I have to install Visual Studio on the machine of where my PHP is ex=
ecuting this exe file?
> >=20
> I do not believe that that would make much difference.
>=20
> --=20
> Regards=2C
> Alf Stockton www.stockton.co.za
>=20
> You could live a better life=2C if you had a better mind and a better bod=
y.

____________________________________________________________ _____
All-in-one security and maintenance for your PC.=A0 Get a free 90-day trial=
!
http://www.windowsonecare.com/purchase/trial.aspx?sc_cid=3Dw l_wlmail=

--_270610ee-55c6-4f38-828e-2ce211f60e2d_--

Re: An Unhandled Win32 Exception Occurred When ExecutingPHP From Windows

am 31.10.2008 15:24:13 von Alf C Stockton

Alice Wei wrote:
> Hi, Al and those who have replied:
>
> I think I am still in midst of this mystery, but it looks like that this error is triggered when I am trying to run this PHP code with the lines I have posted from a Shockwave file application.
> When I only have the PHP with the shell_exec command, it is not giving me any errors.
>
> You are right, my errors do not come from PHP this time.
>
Is the PATH environment variable the same in all cases? I am not really a
Windows expert but I do know that the PATH can vary between Windows itself and
a DOS box. It may be worth checking.

--
Regards,
Alf Stockton www.stockton.co.za

You will become rich and famous unless you don't.

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: An Unhandled Win32 Exception Occurred When Executing PHP From Windows

am 31.10.2008 15:30:53 von Stut

On 31 Oct 2008, at 13:17, Alice Wei wrote:
>> Alice Wei wrote:
>>> Hi,
>>
>> To answer your question, the exe file is written in C and creates
> several output files that calculates various variables based on the
> user input (which the PHP handles).
>>> What I am surprised
> about is that when I run the exe file by itself, there is no error at
> all. However, once I use PHP to "call" the file, it does not crash,
> but
> I have to click No when it executes to allow the program to proceed. I
> tried to follow the instructions from the document in the url below,
> but I could not find the files, and I was not sure if that really is
> the cause of the interruptions of my program.
>>> Does this give you more information in helping me solve my
>>> problem?
>>>
>>> Thanks in advance.
>> Do you have the source of the exe? Is it C or C++ or C#?
>
> The
> exe file is written in C, but I don't have the source file of it,
> since
> my client wanted me to execute it using that to prevent my having to
> execute several codes.
> I have just tried using command prompt to
> execute the command below, and there were no errors, and no Visual
> Studio Just In-Time Debugger pop up boxes generated.
> my-manager.exe -d24 -p20
>
> Do I have to install Visual Studio on the machine of where my PHP is
> executing this exe file?

That debugging window is appearing therefore you must have VS
installed on the machine you're running it on.

There are many things you need to be careful of when executing a shell
from PHP, primarily these are ensuring that permissions are correct
and that the thing you're executing does not attempt to use anything
other than stdin/out/err (i.e. nothing outside the standard C library,
so no windows etc).

The window usually indicates an unhandled exception or other
catastrophic event, in which case you need to be taking it back to
where you got it from and telling them about it. Unless the debugging
window indicates that it's PHP that's crashing not your exe. I'd
double check that first if I were you.

-Stut

--
http://stut.net/

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: An Unhandled Win32 Exception Occurred When ExecutingPHP From Windows

am 01.11.2008 05:24:23 von Alf C Stockton

Stut wrote:
> On 31 Oct 2008, at 13:17, Alice Wei wrote:
>>> Alice Wei wrote:
>>>> Hi,
>>>
>>> To answer your question, the exe file is written in C and creates
>> several output files that calculates various variables based on the
>> user input (which the PHP handles).
As you appear to know what the .exe does why not rewrite it in PHP.

--
Regards,
Alf Stockton www.stockton.co.za

Keep it short for pithy sake.

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php