I want to know the path of the php interpreter from within a php script.
Such the result will be /usr/bin/php for example
I want this to work both for windows and unix.
How can I do it?
edit: I need this information in runtime, so parsing the result of phpinfo() is less than ideal solution
From a command line PHP script, try
$_SERVER['_']. The location of PHP in a web-based script doesn’t really have much meaning, since PHP is embedded into the webserver for the most part, and won’t have any executable path.