I have php installed along with XAMPP. I can run php cli by typing /opt/lampp/bin/php -arguments-here, but I understand there must be a way to register a proper short command php -arguments-here ?

Edit: I edited .bash_profile as per answer below, but I still keep getting the error:

The program 'php' is currently not installed. You can install it by typing: sudo apt-get install php5-cli

link|improve this question

67% accept rate
feedback

2 Answers

Put /opt/lampp/bin in your path.

Add the following lines to your .bash_profile (assuming you have a bash shell):

PATH=/opt/lampp/bin:$PATH
export PATH
link|improve this answer
you just rephrased my question :) How can I do that? – Sejanus Apr 6 '11 at 5:19
feedback

After doing what BetaRide suggested, you can make the change happen in your current shell session by executing:

. ~/.bash_profile

Now, the environment variable $PATH has the value you just assigned to it.

link|improve this answer
still nothing :( the same error about php5-cli being not installed... – Sejanus Apr 7 '11 at 7:00
do: "echo $PATH" in the shell, you should have a "/opt/lampp/bin/" within it, do you? – kmels Apr 7 '11 at 22:43
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.