Can somebody look into https://bugs.php.net/bug.php?id=54514 please?
This causes issues for CLI tools implemented in PHP that are invoked
through Apache Ant, for instance, and need to know the PHP interpreter
that is running them.
See https://github.com/sebastianbergmann/phpunit/issues/432 for an
example of how this affects PHPUnit.
--
Sebastian Bergmann Co-Founder and Principal Consultant
http://sebastian-bergmann.de/ http://thePHP.cc/
On Wed, Dec 7, 2011 at 8:22 AM, Sebastian Bergmann sebastian@php.netwrote:
Can somebody look into https://bugs.php.net/bug.php?**id=54514https://bugs.php.net/bug.php?id=54514please?
This causes issues for CLI tools implemented in PHP that are invoked
through Apache Ant, for instance, and need to know the PHP interpreter
that is running them.See https://github.com/**sebastianbergmann/phpunit/**issues/432https://github.com/sebastianbergmann/phpunit/issues/432for an
example of how this affects PHPUnit.--
Sebastian Bergmann Co-Founder and Principal Consultant
http://sebastian-bergmann.de/ http://thePHP.cc/--
+1, I also seen workarounds of this missing functionality in the symfony2:
https://github.com/symfony/Process/blob/master/PhpExecutableFinder.php
https://github.com/symfony/symfony/blob/master/tests/Symfony/Tests/Component/Process/PhpExecutableFinderTest.php
PHP_BINDIR
is available, and from a quick test, $SERVER[''] has the path
for the php binary also (only tested it on linux, cli).
--
Ferenc Kovács
@Tyr43l - http://tyrael.hu
HI,
I am looking at it :)
how about add a PHP_BINARY
into $_SERVER, but not register as a constant?
thanks,
Can somebody look into https://bugs.php.net/bug.php?id=54514 please?
This causes issues for CLI tools implemented in PHP that are invoked
through Apache Ant, for instance, and need to know the PHP interpreter
that is running them.See https://github.com/sebastianbergmann/phpunit/issues/432 for an
example of how this affects PHPUnit.--
Sebastian Bergmann Co-Founder and Principal Consultant
http://sebastian-bergmann.de/ http://thePHP.cc/--
--
Laruence Xinchen Hui
http://www.laruence.com/
hi Laruence,
HI,
I am looking at it :)how about add a
PHP_BINARY
into $_SERVER, but not register as a constant?
and why not?
Cheers,
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
HI:
- the
PHP_BINARY
is only make sence in cli sapi - if the use script, by chance, has codes: define("PHP_BINARY",
***) will trigger error
thanks
hi Laruence,
HI,
I am looking at it :)how about add a
PHP_BINARY
into $_SERVER, but not register as a constant?and why not?
Cheers,
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
--
Laruence Xinchen Hui
http://www.laruence.com/
HI:
- the
PHP_BINARY
is only make sence in cli sapi- if the use script, by chance, has codes: define("PHP_BINARY",
***) will trigger error
Constants starting with PHP_ are reserved by PHP.
This has come up several times before and we agreed a PHP_BINARY
constant made the most senes.
"The problem" with this feature was when we backtrack binary to load
the php.ini file, it was to early in the startup to be able to
register a constant, variable or whatever..
-Hannes
HI:
- the
PHP_BINARY
is only make sence in cli sapi
It can be the module as well.
However phpUnit has a design mistake here by not allowing to set the
php exec binary path to run the tests. But that's another topic :)
Cheers,
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
2011/12/7 Sebastian Bergmann sebastian@php.net:
Can somebody look into https://bugs.php.net/bug.php?id=54514 please?
This causes issues for CLI tools implemented in PHP that are invoked
through Apache Ant, for instance, and need to know the PHP interpreter
that is running them.See https://github.com/sebastianbergmann/phpunit/issues/432 for an
example of how this affects PHPUnit.--
Sebastian Bergmann Co-Founder and Principal Consultant
http://sebastian-bergmann.de/ http://thePHP.cc/--
PHP_BINDIR
. "/php" ?
Patrick
Hi:
what if I rename the php to something else :)
thanks
2011/12/7 Sebastian Bergmann sebastian@php.net:
Can somebody look into https://bugs.php.net/bug.php?id=54514 please?
This causes issues for CLI tools implemented in PHP that are invoked
through Apache Ant, for instance, and need to know the PHP interpreter
that is running them.See https://github.com/sebastianbergmann/phpunit/issues/432 for an
example of how this affects PHPUnit.--
Sebastian Bergmann Co-Founder and Principal Consultant
http://sebastian-bergmann.de/ http://thePHP.cc/--
PHP_BINDIR
. "/php" ?Patrick
--
--
Laruence Xinchen Hui
http://www.laruence.com/
Can somebody look into https://bugs.php.net/bug.php?id=54514 please?
This causes issues for CLI tools implemented in PHP that are invoked
through Apache Ant, for instance, and need to know the PHP interpreter
that is running them.See https://github.com/sebastianbergmann/phpunit/issues/432 for an
example of how this affects PHPUnit.
I've code to do this on Windows:
#if WIN32
PHP_FUNCTION(get_php_process)
{
char filename[1024];
GetModuleFileName(NULL, filename, 1024);
RETURN_STRING(filename, 1)
}
#endif
On linux, we currently do:
$pid = getmypid()
;
$process = "/proc/{$pid}/exe"
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
hi Derick,
yes, that's what is done in the ini detection implementation, which is
now used in main/.
The only remaining related bug I like to fix is ot PHP_BINDIR, which
is now set at compile time. We could do the same thing than now
PG(PHP_BINDIR).
Can somebody look into https://bugs.php.net/bug.php?id=54514 please?
This causes issues for CLI tools implemented in PHP that are invoked
through Apache Ant, for instance, and need to know the PHP interpreter
that is running them.See https://github.com/sebastianbergmann/phpunit/issues/432 for an
example of how this affects PHPUnit.I've code to do this on Windows:
#if WIN32
PHP_FUNCTION(get_php_process)
{
char filename[1024];
GetModuleFileName(NULL, filename, 1024);
RETURN_STRING(filename, 1)
}
#endifOn linux, we currently do:
$pid =
getmypid()
;
$process = "/proc/{$pid}/exe"cheers,
Derick--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug--
--
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org