From: ale5000 at tiscali dot it
Operating system: Windows XP
PHP version: 5.1.3
PHP Bug Type: Unknown/Other Function
Bug description: exec() don't work
Description:
------------
I have PHP 5.1.3 on IIS server 5.1 installed as ISAPI and exec() says:
Warning: exec() [function.exec]: Unable to fork [tasklist /FI "PID eq
2624" /FO LIST]
Reproduce code:
---------------
if( !function_exists("memory_get_usage") )
{
function memory_get_usage()
{
$pid = getmypid();
if ( substr( PHP_OS, 0, 3 ) == 'WIN' )
{
$output = array();
exec( "tasklist /FI \"PID eq ".$pid."\" /FO
LIST", $output );
return preg_replace( '/[^0-9]/', '', $output[5]
) * 1024;
}
else
{
exec( "ps -eo%mem,rss,pid | grep ".$pid,
$output );
$output = explode(" ", $output[0]);
return $output[1] * 1024;
}
}
}
Expected result:
----------------
The memory used by the script.
Actual result:
--------------
Warning: exec() [function.exec]: Unable to fork [tasklist /FI "PID eq
2624" /FO LIST]
--
Edit bug report at http://bugs.php.net/?id=37316&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=37316&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=37316&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=37316&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37316&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=37316&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37316&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37316&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37316&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37316&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37316&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=37316&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=37316&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37316&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37316&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37316&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37316&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37316&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37316&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37316&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37316&r=mysqlcfg