Edit report at https://bugs.php.net/bug.php?id=54514&edit=1
ID: 54514 Updated by: larue...@php.net Reported by: frederic dot hardy at mageekbox dot net Summary: Get php binary path during script execution -Status: Open +Status: Closed Type: Feature/Change Request Package: PHP options/info functions PHP Version: Irrelevant -Assigned To: +Assigned To: laruence Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. implement in 5.4, thanks Previous Comments: ------------------------------------------------------------------------ [2011-12-07 10:32:56] larue...@php.net Automatic comment from SVN on behalf of laruence Revision: http://svn.php.net/viewvc/?view=revision&revision=320567 Log: Implemented FR #54514 (Get php binary path during script execution). ------------------------------------------------------------------------ [2011-12-07 08:57:46] patrickalla...@php.net PHP does provide a path to the binary directory: PHP_BINDIR However it is true it doesn't contain the executable itself. ------------------------------------------------------------------------ [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