php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49458 passthru is unable to fork
Submitted: 2009-09-03 14:46 UTC Modified: 2010-02-17 14:15 UTC
From: RQuadling at GMail dot com Assigned: pajoye (profile)
Status: Not a bug Package: Filesystem function related
PHP Version: 5.3SVN-2009-09-03 (SVN) OS: Windows XP SP3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: RQuadling at GMail dot com
New email:
PHP Version: OS:

 

 [2009-09-03 14:46 UTC] RQuadling at GMail dot com
Description:
------------
Unable to fork. As a consequence, phpdoc/configure.php fails on windows 
as it is unable to call external scripts.

Run the command below at the command prompt.

This works on PHP 5.3.0 (cli) (built: Jun 29 2009 21:44:56)



Reproduce code:
---------------
php -n -r "echo passthru('php.exe -v');"

Expected result:
----------------
PHP 5.3.1-dev (cli) (built: Sep  3 2009 09:58:01)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

Actual result:
--------------
Warning: passthru(): Unable to fork [php.exe -v] in Command line code on 
line 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-03 14:54 UTC] pajoye@php.net
Which version do you use? It works here using vc9/x86
 [2009-09-03 15:31 UTC] RQuadling at GMail dot com
[2009/09/03 16:18:38] [D:\Personal 
Files\Downloads\Software\Programming\PHP\Latest Snapshots\php-5.3-nts-
win32-VC6-x86-latest] [] >php -n -v
PHP 5.3.1-dev (cli) (built: Sep  3 2009 10:16:30)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

[2009/09/03 16:18:40] [D:\Personal 
Files\Downloads\Software\Programming\PHP\Latest Snapshots\php-5.3-nts-
win32-VC6-x86-latest] [] >php -n -r "echo passthru('php.exe -n -v');"

Warning: passthru(): Unable to fork [php.exe -v] in Command line code 
on line 1

[2009/09/03 16:18:48] [D:\Personal 
Files\Downloads\Software\Programming\PHP\Latest Snapshots\php-5.3-nts-
win32-VC6-x86-latest] [] >


Basically, all the latest snapshots from windows.php.net are failing 
for me.

All the official releases are working for me.

Checking historical versions ...

PHP 5.3.1-dev (cli) (built: Aug 27 2009 23:21:09) Works
PHP 5.3.1-dev (cli) (built: Aug 28 2009 00:20:34) Works
PHP 5.3.1-dev (cli) (built: Aug 28 2009 01:20:31) Works

I'll get the historical updates and let you know when the failure 
started.

Have you got any uncommitted code?
 [2009-09-03 15:32 UTC] RQuadling at GoogleMail dot com
[2009/09/03 16:18:38] [D:\Personal 
Files\Downloads\Software\Programming\PHP\Latest Snapshots\php-5.3-nts-
win32-VC6-x86-latest] [] >php -n -v
PHP 5.3.1-dev (cli) (built: Sep  3 2009 10:16:30)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

[2009/09/03 16:18:40] [D:\Personal 
Files\Downloads\Software\Programming\PHP\Latest Snapshots\php-5.3-nts-
win32-VC6-x86-latest] [] >php -n -r "echo passthru('php.exe -n -v');"

Warning: passthru(): Unable to fork [php.exe -v] in Command line code 
on line 1

[2009/09/03 16:18:48] [D:\Personal 
Files\Downloads\Software\Programming\PHP\Latest Snapshots\php-5.3-nts-
win32-VC6-x86-latest] [] >


Basically, all the latest snapshots from windows.php.net are failing 
for me.

All the official releases are working for me.

Checking historical versions ...

PHP 5.3.1-dev (cli) (built: Aug 27 2009 23:21:09) Works
PHP 5.3.1-dev (cli) (built: Aug 28 2009 00:20:34) Works
PHP 5.3.1-dev (cli) (built: Aug 28 2009 01:20:31) Works

I'll get the historical updates and let you know when the failure 
started.

Have you got any uncommitted code?
 [2009-09-03 15:34 UTC] pajoye@php.net
It works on 2008/Vista/Win7 but fails on XP or 2k3. It seems that CreateProcessAsUser is more restrictive in these versions than in newer releass forcing us to check for ERROR_NO_TOKEN.

If the current thread is not impersonated, it has no token assigned.

Can you try this patch please? http://pastie.org/604529


 [2009-09-03 17:27 UTC] raulsalitrero at gmail dot com
i have just tested the patch and it seems to work, the output i get is:
on windows xp sp3 (all patches)


C:\php>php -n -r "echo passthru('php.exe -n -v');"
PHP 5.3.1-dev (cli) (built: Sep  3 2009 10:04:34)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

before the patch, it fails just like the report using svn version up to date.
 [2009-09-03 19:18 UTC] pajoye@php.net
As this bug is the result of the 1st fix for #27051, I like to continue to follow it there instead, less confusion.

A commit has been done using the patch pasted here in my previous comment, using #27051 as reference.

Mark as bogus/duplicate.
 [2009-09-03 19:18 UTC] pajoye@php.net
As this bug is the result of the 1st fix for #27051, I like to continue to follow it there instead, less confusion.

A commit has been done using the patch pasted here in my previous comment, using #27051 as reference.

Mark as bogus/duplicate.
 [2010-02-17 14:15 UTC] pajoye@php.net
Quick note here. It is necessary to give a given IUSR_* the permission to use cmd.exe (%COMSPEC%). It is recommended not to do it as it may introduce security issues, obviously. But if you really want to do it, use:

cacls %COMSPEC% /E /G IUSR_xxxx:R
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 15:01:36 2025 UTC