Jump to content

php.exe location


The Little Guy

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.