ID: 37316
User updated by: ale5000 at tiscali dot it
Reported By: ale5000 at tiscali dot it
-Status: Feedback
+Status: Open
Bug Type: Unknown/Other Function
Operating System: Windows XP
-PHP Version: 5.1.3
+PHP Version: 5.1.4
New Comment:
Yes, it is in the path and it is executable.
I have also tried:
echo system("c:\windows\system32\hostname.exe");
same result.
Previous Comments:
------------------------------------------------------------------------
[2006-05-05 18:52:24] [EMAIL PROTECTED]
See if "tasklist" is in your path and executable or try pecl/win32ps.
------------------------------------------------------------------------
[2006-05-04 23:01:13] 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]
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37316&edit=1