From inside a PHP program I want to know the location of the binary executing it. Perl has
for this purpose. Is there an equivalent in PHP?
This is so it can execute a child PHP process using itself (rather than hard code a path or assume "php" is correct).
Things I've tried and don't work:
- I'm using lighttpd + FastCGI, not Apache + mod_php. So yes, there is a PHP binary.
- eval/include is not a solution because I'm spawning a server which has to live on beyond the request.
looks like what I want from the command line but its actually from an environment variable set by the shell of the last executed program. When run from a web server this is the web server binary.
will not work because the PHP binary is not guaranteed to be the same one as is in the web server's
Thanks in advance.