Edit report at https://bugs.php.net/bug.php?id=54514&edit=1

 ID:                 54514
 Comment by:         patrickalla...@php.net
 Reported by:        frederic dot hardy at mageekbox dot net
 Summary:            Get php binary path during script execution
 Status:             Open
 Type:               Feature/Change Request
 Package:            PHP options/info functions
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

PHP does provide a path to the binary directory:
PHP_BINDIR

However it is true it doesn't contain the executable itself.


Previous Comments:
------------------------------------------------------------------------
[2011-04-12 14:11:00] frederic dot hardy at mageekbox dot net

Description:
------------
Currently, PHP does not provide any solution to retrieve PHP binary path in 
userland.
There is a workaround with some *NIX shells like bash, which provide $_, 
available in $_SERVER['_'] in userland.
However, it's not a reliable solution (cron task, etc.), and this hack is not 
available on Windows.
So, a constant like PHP_BINARY (similar to PHP_VERSION and other PHP_* 
constants) seems to be a good solution.



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=54514&edit=1

Reply via email to