location of the PHP executable



Hi,

I have looked in the documentation but can't find it:

My PHP script (which is run from the command prompt - CLI) needs to know
the file system location of the PHP executable. This is because it needs
to run a second PHP script. I know about the "which" command but it's
not available in all OSes, and that might not be the currently running
executable anyway.

I could prompt the user for this, but that seems kind of silly. Surely,
there must be some way of looking it up automatically?

Thanks,

Mattias
.



Relevant Pages

  • Re: [PHP] location of the PHP executable
    ... My PHP script (which is run from the command prompt - CLI) needs to know ... the file system location of the PHP executable. ...
    (php.general)
  • Re: [PHP] location of the PHP executable
    ... Don't you have to run locate -u first to generate the database before using ... > My PHP script (which is run from the command prompt - CLI) needs to know ... > the file system location of the PHP executable. ...
    (php.general)
  • Re: [PHP] location of the PHP executable
    ... not an updated one at least, updatedb can also be used to update. ... My PHP script (which is run from the command prompt - CLI) needs to ... know the file system location of the PHP executable. ...
    (php.general)
  • Re: [PHP] location of the PHP executable
    ... My PHP script (which is run from the command prompt - CLI) needs to ... the file system location of the PHP executable. ...
    (php.general)
  • Re: Still cant fix it.
    ... i would first try to run your php script from the cli; ... I've tried only to run it from browser. ... I've just tried to run it from cli and I get error message: ... I will write simplier script without using mysql. ...
    (php.general)