bachx Posted October 20, 2007 Share Posted October 20, 2007 I need to find out the PHP absolute path on the server (e.g /usr/bin/php). Any ideas? Link to comment https://forums.phpfreaks.com/topic/74091-how-to-get-the-php-parent-directory/ Share on other sites More sharing options...
0x00 Posted October 20, 2007 Share Posted October 20, 2007 Try this to check the server vars: while (list($k, $v) = each($_SERVER)) { print "'".$k."' => '".$v."' <br>"; } Link to comment https://forums.phpfreaks.com/topic/74091-how-to-get-the-php-parent-directory/#findComment-374077 Share on other sites More sharing options...
bachx Posted October 20, 2007 Author Share Posted October 20, 2007 I get that: 'PATH' => '/usr/local/bin:/usr/bin:/bin' Still, what's the exact path? I'm not so sure. Link to comment https://forums.phpfreaks.com/topic/74091-how-to-get-the-php-parent-directory/#findComment-374078 Share on other sites More sharing options...
Orio Posted October 20, 2007 Share Posted October 20, 2007 <?php echo $_SERVER['DOCUMENT_ROOT']; ?> Orio. Link to comment https://forums.phpfreaks.com/topic/74091-how-to-get-the-php-parent-directory/#findComment-374080 Share on other sites More sharing options...
bachx Posted October 20, 2007 Author Share Posted October 20, 2007 I want the PHP core root, not the document root. Link to comment https://forums.phpfreaks.com/topic/74091-how-to-get-the-php-parent-directory/#findComment-374081 Share on other sites More sharing options...
0x00 Posted October 20, 2007 Share Posted October 20, 2007 I presume that it'll be user specific (since apache runs as a user) so '/usr/local/bin' should take preceedence, but it's been a while since LFS... ??? Link to comment https://forums.phpfreaks.com/topic/74091-how-to-get-the-php-parent-directory/#findComment-374083 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.