For all my years running PHP CLI on Windows, I have started my scripts with .bat
files like this:
php test.php
php
resolves to C:\PHP\php.exe
due to my PATH
.
No problems with this. Except they always get that pesky cmd.exe
icon/Taskbar group.
So, just a few minutes ago, I instead created a shortcut on my desktop directly to C:\PHP\php.exe
, and entered the full path to my script as an argument to it. Now, when I double-click that "PHP" icon on my desktop, it opens not cmd.exe
, but PHP.exe directly, so that it gets a PHP icon instead of cmd.exe icon, and puts itself in its own Taskbar group.
However, besides the icon, it looks identical in every other way to cmd.exe. I'm pretty sure that it is cmd.exe, just with the PHP icon. Or is this some kind of custom terminal, entirely separated from cmd.exe?
There is also a php-win.exe
executable in C:\PHP
. I've never been able to figure out what this is or how it differs from php.exe
in the same dir. If I do the same thing as above with it, it instantly crashes with the logged PHP error:
cli_get_process_title(): cli_get_process_title had an error: Windows error code: 6
There is no mention whatsoever in the "README" file about this executable.
I have many times experimented with and tried to use PowerShell, but there is always weird glitches and issues with it, which is why I've stuck to cmd.exe. Also, having to make a ton of shortcuts all the time and edit their arguments to represent the full paths to my PHP scripts is much worse than having .bat files which run my PHP scripts in a much nicer manner, albeit with the pesky cmd.exe icon instead of the PHP one.
This "Windows Terminal" thing I've seemingly heard about for years, but it's still nowhere to be found on my machine.
Ideally, I would want to be able to have my own custom icon, neither taken from cmd.exe nor php.exe, but the only way I've found to do that in the past is to copy cmd.exe, modify it and then use that everywhere. That is not an elegant or sensible solution.
Please explain to me what php-win.exe is for, whether php.exe is actually just cmd.exe with a different icon, and if there is something simple I can do to get my own icon/branding for my PHP CLI system.