ID:               37316
 Updated by:       [EMAIL PROTECTED]
 Reported By:      ale5000 at tiscali dot it
-Status:           Open
+Status:           Feedback
 Bug Type:         Unknown/Other Function
 Operating System: Windows XP
 PHP Version:      5.1.3
 New Comment:

See if "tasklist" is in your path and executable or try pecl/win32ps.


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to