burhankhan Posted January 31, 2007 Share Posted January 31, 2007 Hi:Can any body tell me how to get php path?like: /usr/local/bin/phpI search, but there is no function that can return php path.ThanksBurhan Khan Quote Link to comment Share on other sites More sharing options...
Orio Posted January 31, 2007 Share Posted January 31, 2007 [code]<?php echo $_SERVER['PATH'] ?>[/code]Simple, isn't it?Orio. Quote Link to comment Share on other sites More sharing options...
burhankhan Posted January 31, 2007 Author Share Posted January 31, 2007 No!This will return /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbinBut i need one path to set cron job, like /usr/local/bin/phpThanksBurhan Khan Quote Link to comment Share on other sites More sharing options...
Orio Posted January 31, 2007 Share Posted January 31, 2007 Try:[code]<?phpecho "/usr/local/bin/php";?>[/code]...Orio. Quote Link to comment Share on other sites More sharing options...
burhankhan Posted January 31, 2007 Author Share Posted January 31, 2007 This will print path.BUT is php always exist in /usr/local/bin/php ???On different server, php location can be different!So how to get exact path of php? Quote Link to comment 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.