ID: 25361 Updated by: [EMAIL PROTECTED] Reported By: sam at freepeers dot com Status: Closed Bug Type: Program Execution Operating System: Windows 2000 PHP Version: 4.3.2 New Comment:
This was fixed. HEAD : http://cvs.php.net/viewvc.cgi/TSRM/tsrm_win32.c?r1=1.34&r2=1.35 5.2x : http://cvs.php.net/viewvc.cgi/TSRM/tsrm_win32.c?r1=1.27.2.1.2.8&r2=1.27.2.1.2.9 5.3x : http://cvs.php.net/viewvc.cgi/TSRM/tsrm_win32.c?r1=1.27.2.1.2.7.2.1&r2=1.27.2.1.2.7.2.2 Can the 5.2x commit be reversed? This caused a minor issue with phd for 5.2. Whilst it is easily fixed it is a BC mid version (5.2.6 vs 5.2.7-dev). Having it at 5.3+ allows the BC to be documented as part of the changes to 5.3. Thank you. Richard Quadling. Previous Comments: ------------------------------------------------------------------------ [2008-05-30 10:04:10] [EMAIL PROTECTED] This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Fixed in 5.2, 5.3 and 6.0 ------------------------------------------------------------------------ [2008-01-26 13:09:37] t03 at springtimesoftware dot com Under Windows, here is a workaround to the bugs in PHP and Windows: 1. Copy cmd.exe into the main PHP folder (usually C:\php or C:\Program Files\php). This gives PHP authorization to run it. 2. In your PHP code, execute the command "Exec.cmd <command> <args>". Each arg can be quoted. Consider calling escapeshellcmd or escapeshellarg. 3. Create a file Exec.cmd where your PHP code can find it. It should contain the following: rem @echo off rem echo Args: %1 %2 %3 %4 %5 %6 %7 %8 %9 start "Exec.cmd Is Running" /b %1 %2 %3 %4 %5 %6 %7 %8 %9 exit 4. Change the /b to /w for synchronous execution. 5. This is rough. It should be changed to return the command's error code (errorlevel), etc. David Spector ------------------------------------------------------------------------ [2007-08-11 01:00:00] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2007-08-03 09:26:56] [EMAIL PROTECTED] >From the cmd.exe /? help If /C or /K is specified, then the remainder of the command line after the switch is processed as a command line, where the following logic is used to process quote (") characters: 1. If all of the following conditions are met, then quote characters on the command line are preserved: - no /S switch - exactly two quote characters - no special characters between the two quote characters, where special is one of: &<>()@^| - there are one or more whitespace characters between the the two quote characters - the string between the two quote characters is the name of an executable file. 2. Otherwise, old behavior is to see if the first character is a quote character and if so, strip the leading character and remove the last quote character on the command line, preserving any text after the last quote character. My intent is to force the command line supplied by exec() et. al. to be wrapped in a pair of quotes, thus forcing option 2 to be used. For older windows (9x), using command.com, the help is ... /C string Carries out the command specified by string, and then stops. If 9x is not a concern (I'm getting it tested next week as I don't have a 9x machine at hand), then the first patch could be used which only wraps "" around NT+. ------------------------------------------------------------------------ [2007-08-03 09:10:28] [EMAIL PROTECTED] Non volatile link (Sorry Pierre) : http://rquadling.php1h.com/proc_open.c.diff2 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/25361 -- Edit this bug report at http://bugs.php.net/?id=25361&edit=1