You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a script is executed with the CLI, as a relative path, such as file.php or ../file.php, $_SERVER['SCRIPT_FILENAME'] will contain the relative path specified by the user.
Isn't this a bug? Bc it states it should be an absolute path, and it's obviously not. Which means the 2 are identical in CLI.
Which leads back to my original example:
due to this inconsistency, it's impossible to find the currently executing script's path in CLI, if the path passed to PHP isn't absolute and chdir() is called anywhere in the application.
This makes finding the source of a bug from an error trace almost impossible, if there are multiple directories with this file