|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-05-04 23:01 UTC] ale5000 at tiscali dot it
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]
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 01:00:01 2025 UTC |
Yes, it is in the path and it is executable. I have also tried: echo system("c:\windows\system32\hostname.exe"); same result.