ID: 28101 Updated by: [EMAIL PROTECTED] Reported By: bksmith at windlogics dot com -Status: Open +Status: Bogus Bug Type: Program Execution Operating System: Windows 2000 PHP Version: 4.3.6 New Comment:
You are using CGI version (php -v). Use php.exe from cli directory. Previous Comments: ------------------------------------------------------------------------ [2004-04-22 03:23:47] bksmith at windlogics dot com Description: ------------ When a CLI script passed to the php interpreter with a UNC path, the system(program, return value) function call does not function in the same way as it does when a CLI script is passed to the interpreter with a non-UNC path. The problem seems to be that php bases its idea of the working directory on the path to the script it is running, rather than the directory in which php was run. This makes sense in the context of a web server, but does not seem to make sense on the command line. The example provided does not fail due to this problem because of the example's extreme simplicity, but illustrates the error message provided by CMD.exe when this issue arises. One can easily imagine instances where a script makes assumptions about working directory that are invalid when the working directory becomes C:\WINNT\SYSTEM32 or the like. For programmers attempting to migrate from other languages, it may be confusing that the working directory is not actually the directory they are working in. Reproduce code: --------------- <?php $retString = system("echo what", $retVal); ?> Expected result: ---------------- E:\WIND_PRODUCTION\bin>php test.php Content-type: text/html X-Powered-By: PHP/4.3.6 what Actual result: -------------- E:\WIND_PRODUCTION\bin>php \\37bananas\work\WIND_PRODUCTION\bin\test.php CMD.EXE was started with '\\37bananas\work\WIND_PRODUCTION\bin' as the current d irectory path. UNC paths are not supported. Defaulting to Windows directory. Content-type: text/html X-Powered-By: PHP/4.3.6 what ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28101&edit=1