The Little Guy Posted September 5, 2010 Share Posted September 5, 2010 I have a script that runs in the command line. Is it possible to get where the php interpreter file is? I know I have it running from "C:\php\php.exe" but If I give the script to someone else, php.exe may not be there, and it may not even be a windows operating system, so is there any command to get the location of that file? Link to comment https://forums.phpfreaks.com/topic/212559-phpexe-location/ Share on other sites More sharing options...
JasonLewis Posted September 5, 2010 Share Posted September 5, 2010 On a linux box (not that I'm a pro or anything) you don't need to specify a location to run a PHP script from the command line. All you need to write is: php -f [file] Or whatever the command is. As for Windows, perhaps provide a prompt for the user to input the location of their php.exe? Link to comment https://forums.phpfreaks.com/topic/212559-phpexe-location/#findComment-1107433 Share on other sites More sharing options...
The Little Guy Posted September 5, 2010 Author Share Posted September 5, 2010 windows it is the same, if the user has php defined in their Environment Variables under Path. If they don't have it defined, then it is an unrecognized command. Link to comment https://forums.phpfreaks.com/topic/212559-phpexe-location/#findComment-1107593 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.