Page 1 of 2

how can i use php from command line ? step

Posted: Mon Feb 19, 2007 2:09 pm
by ms_dos10
Hi all here i have this question when I'm start learning php , no one put lessons how we can use php from command line ( does ) ?
here because I'm using windows , and xampp package to install php , mysql and etc .
any one can help step by step any setting to use php from CLI
thanks

Posted: Mon Feb 19, 2007 2:14 pm
by Mightywayne
.. I'm... not too sure what you're asking. And I'm usually good with this stuff. Can you rephrase?

Posted: Mon Feb 19, 2007 2:19 pm
by ms_dos10
My question is how to use php on command line in windows .

i need steps to follow ?
what i need to do use it that way CLI?
how can i do that ?

Posted: Mon Feb 19, 2007 2:29 pm
by Kieran Huggins

Posted: Mon Feb 19, 2007 2:40 pm
by ms_dos10
i read all this be for but i don't get anything from it

Posted: Mon Feb 19, 2007 2:56 pm
by Luke
what don't you understand?

Posted: Mon Feb 19, 2007 3:02 pm
by ms_dos10
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Kings>_


this is my command line how can i use php here . that all what i want . can u help me ?

Posted: Mon Feb 19, 2007 3:17 pm
by feyd
You type "php" (provided it's in your path) followed by some arguments...

Posted: Mon Feb 19, 2007 3:36 pm
by ms_dos10
You type "php" (provided it's in your path) followed by some arguments...
which arguments ?

Posted: Mon Feb 19, 2007 3:38 pm
by feyd
ms_dos10 wrote:which arguments ?
Valid ones.

Posted: Mon Feb 19, 2007 3:55 pm
by ms_dos10
i can 't write the whole path ? it stop here
C:\php> cd CLI press enter give me error
the system cannot find the path specified
what can i do

Posted: Mon Feb 19, 2007 4:00 pm
by feyd
"php" is the name of the executable.

Posted: Mon Feb 19, 2007 4:06 pm
by ms_dos10
no name the folder where php is there i have to specified the whole path , is that right or no

Posted: Mon Feb 19, 2007 5:02 pm
by Chris Corbyn
~feyd was telling you, not asking you. "php" isn the name of the executable. i.e "php.exe" if you're on windows.

Code: Select all

php yourscript.php
#or for one-liners
php -r "$foo = 42; echo $foo;"
#or to get a readline, interactive console up
php -a

Posted: Thu Feb 22, 2007 5:52 pm
by ms_dos10
Sorry for replay let i have some problem . and now i get how to run php from command line , but one thing i don't get it yet .
how can i write script accept number entered from keyboard and display it
thanx all for help