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? Quote 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>"; } Quote 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. Quote 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. Quote 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. Quote 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... ??? Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.