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 Link to comment https://forums.phpfreaks.com/topic/36470-get-php-path/ 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. Link to comment https://forums.phpfreaks.com/topic/36470-get-php-path/#findComment-173586 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 Link to comment https://forums.phpfreaks.com/topic/36470-get-php-path/#findComment-173588 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. Link to comment https://forums.phpfreaks.com/topic/36470-get-php-path/#findComment-173591 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? Link to comment https://forums.phpfreaks.com/topic/36470-get-php-path/#findComment-173592 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.