What is the difference between executing php from command line and from HTTP? Do they use the same executable such as (php.exe or php-cgi.exe ( Apache or IIS ))? Do the r
Whether PHP is invoked via a web server module or CLI, the same binary base is used (but can sometimes be configured to use different ini's which can affect the script). It's environment will also be different so environment variables will not be exact.
PHP is also aware that it's been invoked differently and will tailor it's output to suit that (i.e., phpinfo(); output will be formatted differently when called via CLI).