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


Put /opt/lampp/bin in your path.

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

export PATH
  • you just rephrased my question :) How can I do that? – Sejanus Apr 6 '11 at 5:19

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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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