Re: [PHP] location of the PHP executable



Mattias Thorslund wrote:
Jim Lucas wrote:
....

$ /my-location-of/php myscript.php
/my-location-of/php
$

I was hoping there's a function or $_SERVER property that would contain
this?

have you tried looking for this info you want?
I can't say for sure if it always exists but on the few boxes
I tried I found and entry in both $_SERVER and $_ENV:

"_" => '/usr/bin/php'

but that was only on linux.
on windows (where my php cli install is a bit borked),
I didn't find it but I did find "PHPRC" which points to
the directory that the php executable lives in.

these maybe of some use.
then again what ever it is your trying to do with the php script
you seem to need to run inside another instance of php could probably
be run within the context of the calling script - if you run it inside
a function you can stop any kind of variable scope clashes (assuming there are
no symbol name clashes [e.g. duplicate functions/classes]):

function runit()
{
include 'myscript.php';
}

it's just a thought.

Thanks again,

Mattias

.



Relevant Pages

  • Re: Attempt to de-mystify AJAX
    ... created and populated by the PHP script. ... string is initialized in line 1 to the opening select tag. ...
    (comp.databases.pick)
  • Re: File permissions for a wiki-like site
    ... the content using PHP scripts. ... content to be writable by my PHP script. ... The only one doing the writing will be the Apache user itself. ... The web user is used for things like ...
    (comp.lang.php)
  • Re: File permissions for a wiki-like site
    ... the content using PHP scripts. ... content to be writable by my PHP script. ... The only one doing the writing will be the Apache user itself. ... The web user is used for things like ...
    (comp.lang.php)
  • Re: File permissions for a wiki-like site
    ... the content using PHP scripts. ... content to be writable by my PHP script. ... The only one doing the writing will be the Apache user itself. ... The web user is used for things like ...
    (comp.lang.php)
  • Re: High Scores
    ... If you want to view High scores it returns Could Not load scores ... here is the PHP script ... Edit the game Flash file to point to this file on your server ... >> And the PHP script is here ...
    (alt.php)