Page 1 of 1

Command line with php doesn't work

PostPosted: 07. May 2009 20:36
by supertoto
Hi everybody,

I've installed xampp, it works (http://localhost/ ok). Now I try to execute a script with php command line but it doesn't work.
I see the following message :
Code: Select all
bash: php: command not found


In fact I understand that php isn't in environment variable
I test execution with the following terms : php-5.2.5 toto.php in the following path : /opt/lampp/bin/
But it's same.

Here is my basic script toto.php :
Code: Select all
<?php
  echo "toto";
?>


So, my question is : How should I do for the command line interface works with php ?

Thank you in advance.

Re: Command line with php doesn't work

PostPosted: 07. May 2009 20:48
by Wiedmann
So, my question is : How should I do for the command line interface works with php ?

Exactly like with every other command which is not in your $PATH (use the full path to the command).
/opt/lampp/bin/php

Re: Command line with php doesn't work

PostPosted: 07. May 2009 21:12
by supertoto
Thank you very much.
I use this command each time I launch Xampp and I don't think to do this.
I am ashamed !

Well done.