Invoking a PHP script - sometimes the full path is required
I have noticed that sometimes I can invoke a php script like this:
Code:
linux_prompt# php -q my_script.php Code:
linux_prompt# /usr/bin/php5 my_script.php Any help would be very much appreciated. |
Are you seeing that different behaviour as the same user,
or are you su'ed to someone else? Cheers, Tink |
I'm not talking about different behavior on a single machine. I'm talking about different behavior from server to server.
|
For server to server differences, it means its not always being set in the PATH var.
Fundamentally, you've got /etc/profile which is applied to all user logins, and .bash_profile which is a hidden file in the home dir of each user and can contain different info eg PATH definitions, for each user. HTH |
PATH issue
If the location of an application is not in your PATH, then you will have to type the full path name - this is true for every application, not only for PHP.
To run PHP from the command-line it has to have been built with the CLI option. This can be different among different servers. Linux Archive |
All times are GMT -5. The time now is 02:45 PM. |