Req #54514 [Com]: Get php binary path during script execution

From: Date: Wed, 07 Dec 2011 08:57:46 +0000
Subject: Req #54514 [Com]: Get php binary path during script execution
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-165717@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=54514&edit=1 ID: 54514 Comment by: patrickallaert@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

« previous php.bugs (#165717) next »