"CreateProcess failed" when proc_open()

"CreateProcess failed" when proc_open()

am 24.02.2007 15:19:58 von Alexander Rybin

Hi!

Could anyone help me.
Here is my problem.

I need to start new external process. I do it by the next code:
$descriptorspec = array(
0 => array("pipe", "r"), // stdin is a pipe that the child
will read from
1 => array("pipe", "w"), // stdout is a pipe that the
child will write to
2 => array("pipe", "w"), // stderr is a file to write to
);

$hf = proc_open( $ex_path, $descriptorspec, $pipes );

$ex_path is a correct path to my executable. However, I get "CreateProcess
failed" when it runs.
I have IIS 6, running in its native process model. Also I have PHP 5.2.1.

What's wrong? Please, help!

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

RE: "CreateProcess failed" when proc_open()

am 27.02.2007 07:49:00 von Gustav Wiberg

Hi there!

I don't know, but this may give you a clue?

Grabbe from http://se2.php.net/manual/sv/function.proc-open.php
"Not: Windows compatibility: Descriptors beyond 2 (stderr) are made availab=
le to the child process as inheritable handles, but since the Windows archi=
tecture does not associate file descriptor numbers with low-level handles, =
the child process does not (yet) have a means of accessing those handles. S=
tdin, stdout and stderr work as expected.=20

Not: If you only need a uni-directional (one-way) process pipe, use popen()=
instead, as it is much easier to use."
=20

Best regards
/Gustav Wiberg


-----Original Message-----
From: Alexander Rybin [mailto:rybin@allandgroup.ru]=20
Sent: Saturday, February 24, 2007 3:20 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] "CreateProcess failed" when proc_open()

Hi!

Could anyone help me.
Here is my problem.

I need to start new external process. I do it by the next code:
$descriptorspec =3D array(
0 =3D> array("pipe", "r"), // stdin is a pipe that the ch=
ild=20
will read from
1 =3D> array("pipe", "w"), // stdout is a pipe that the=
=20
child will write to
2 =3D> array("pipe", "w"), // stderr is a file to write t=
o
);

$hf =3D proc_open( $ex_path, $descriptorspec, $pipes );

$ex_path is a correct path to my executable. However, I get "CreateProcess=
=20
failed" when it runs.
I have IIS 6, running in its native process model. Also I have PHP 5.2.1.

What's wrong? Please, help!=20

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

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

RE: "CreateProcess failed" when proc_open()

am 27.02.2007 09:31:51 von Alexander Rybin

Hi!

I solved the problem.

Php 5.2.1 still use cmd.exe for run any executables (or may be I have =
made
mistake in "other_options").=20
But Win2003 does not give read and execute permission on cmd.exe for =
simple
users and guest users especially, and IIS 6 (unlike Apache) runs website
under very restricted user, who, of course, have no permissions for =
reading
and executing the cmd.exe.

If you need to run executables in php code under IIS6 control, you must =
give
read and execute permission on cmd.exe to users, IIS6 uses to run =
websites
under.

=F3 Õ×ÁÖÅÎÉÅ=CD,
áÌÅËÓÁÎÄ=D2 òÙÂÉ=CE,
ÄÉÒÅËÔÏÒ ÇÒÕÐÐÙ "áÌÌÁÎÄ"
icq: 13391736,
www.allandgroup.ru
=20

-----Original Message-----
From: Gustav Wiberg [mailto:gustav@hmn.se]=20
Sent: Tuesday, February 27, 2007 9:49 AM
To: 'Alexander Rybin'; 'php-windows@lists.php.net'
Subject: RE: [PHP-WIN] "CreateProcess failed" when proc_open()

Hi there!

I don't know, but this may give you a clue?

Grabbe from http://se2.php.net/manual/sv/function.proc-open.php
"Not: Windows compatibility: Descriptors beyond 2 (stderr) are made
available to the child process as inheritable handles, but since the =
Windows
architecture does not associate file descriptor numbers with low-level
handles, the child process does not (yet) have a means of accessing =
those
handles. Stdin, stdout and stderr work as expected.=20

Not: If you only need a uni-directional (one-way) process pipe, use =
popen()
instead, as it is much easier to use."
=20

Best regards
/Gustav Wiberg


-----Original Message-----
From: Alexander Rybin [mailto:rybin@allandgroup.ru]=20
Sent: Saturday, February 24, 2007 3:20 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] "CreateProcess failed" when proc_open()

Hi!

Could anyone help me.
Here is my problem.

I need to start new external process. I do it by the next code:
$descriptorspec =3D array(
0 =3D> array("pipe", "r"), // stdin is a pipe that the =
child

will read from
1 =3D> array("pipe", "w"), // stdout is a pipe that =
the=20
child will write to
2 =3D> array("pipe", "w"), // stderr is a file to =
write to
);

$hf =3D proc_open( $ex_path, $descriptorspec, $pipes );

$ex_path is a correct path to my executable. However, I get =
"CreateProcess=20
failed" when it runs.
I have IIS 6, running in its native process model. Also I have PHP =
5.2.1.

What's wrong? Please, help!=20

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

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