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.4


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

[2006-05-22 00:49:28] jon at thejon dot org

You need to make sure that the file has executable permission for your
web user. It may also need executable permission for cmd.exe, but I
would think this is very large security hole... I hope there is another
way with allowing access to cmd.exe.

------------------------------------------------------------------------

[2006-05-05 23:00:16] ale5000 at tiscali dot it

Yes, it is in the path and it is executable.
I have also tried:
  echo system("c:\windows\system32\hostname.exe");
same result.

------------------------------------------------------------------------

[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

Reply via email to