Command line with php doesn't work

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Command line with php doesn't work

Postby supertoto » 07. May 2009 20:36

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.
supertoto
 
Posts: 4
Joined: 07. May 2009 19:35

Re: Command line with php doesn't work

Postby Wiedmann » 07. May 2009 20:48

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
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Command line with php doesn't work

Postby supertoto » 07. May 2009 21:12

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.
supertoto
 
Posts: 4
Joined: 07. May 2009 19:35


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 5 guests