RE: Strange exec() behaviour with php-win.exe (5.5.9), opens a VISIBLE intermediating CMD.exe
Emm N. <[email protected]> Sat, 1 Mar 2014 23:04:31 +0200
| Newsgroups | gmane.comp.php.windows |
|---|---|
| Message-ID | <[email protected]> |
Forgot the rich text on... 2nd time, hope it posts formatted properly.
I use PHP on my system for some tasks, since I already know the language
and don't want the whole windows script baggage, so I sometimes use
PHP-WIN.EXE to do some tasks.
[unimportant] One of these tasks is simply to check a file's binary header,
while having the same extension, and run it through the appropriate program.
file.x opens: php-win.exe script.php path_to_file.x
script.php determines what file.x might be and opens program A if it has
certain header, B if another header and so on.[/unimportant]
I had (still have but don't use) 5.2.11, this one opens programs A to Z properly...
no interfering CMD window. It waits in the background for the program to finish,
but that was all.
Now I have 5.5.9.0 and when I use php-win.exe I get the intermeriating CMD.exe
with a visible window.
Running: exec($app1 . " \"" . $fpath . "\"") gives me:
php-win.exe
command: "C:\tools\php-win.exe" "C:\tools\wrapper.php" "D:\file.x"
-> child process: cmd.exe
command: cmd.exe /c "C:\tools\appA.exe "D:\file.x""
-> child of cmd.exe: appA.exe
command: C:\tools\appA.exe "D:\file.x"
5.5.9.0 - CMD's window is visible
5.2.11 - CMD's window is hidden
I know about these workarounds but they don't answer my problem:
- pclose(popen("start /B ". $app1 . " \"" . $fpath . "\"", "r"));
=> briefly opens the cmd window and closes
- $WshShell = new COM("WScript.Shell"); $oExec = $WshShell->Run...
=> didn't run it, but it's WScript, I want PHP only
So why and what to set or did something unsettable change in PHP's engine
and there's no solution besides the workarounds?
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php