PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ms_dos10
Forum Commoner
Posts: 42 Joined: Tue Jul 25, 2006 8:10 am
Post
by ms_dos10 » Mon Feb 19, 2007 2:09 pm
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
Mightywayne
Forum Contributor
Posts: 237 Joined: Sat Dec 09, 2006 6:46 am
Post
by Mightywayne » Mon Feb 19, 2007 2:14 pm
.. I'm... not too sure what you're asking. And I'm usually good with this stuff. Can you rephrase?
ms_dos10
Forum Commoner
Posts: 42 Joined: Tue Jul 25, 2006 8:10 am
Post
by ms_dos10 » Mon Feb 19, 2007 2:19 pm
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 ?
ms_dos10
Forum Commoner
Posts: 42 Joined: Tue Jul 25, 2006 8:10 am
Post
by ms_dos10 » Mon Feb 19, 2007 2:40 pm
i read all this be for but i don't get anything from it
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Mon Feb 19, 2007 2:56 pm
what don't you understand?
ms_dos10
Forum Commoner
Posts: 42 Joined: Tue Jul 25, 2006 8:10 am
Post
by ms_dos10 » Mon Feb 19, 2007 3:02 pm
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 ?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Feb 19, 2007 3:17 pm
You type "php" (provided it's in your path) followed by some arguments...
ms_dos10
Forum Commoner
Posts: 42 Joined: Tue Jul 25, 2006 8:10 am
Post
by ms_dos10 » Mon Feb 19, 2007 3:36 pm
You type "php" (provided it's in your path) followed by some arguments...
which arguments ?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Feb 19, 2007 3:38 pm
ms_dos10 wrote: which arguments ?
Valid ones.
ms_dos10
Forum Commoner
Posts: 42 Joined: Tue Jul 25, 2006 8:10 am
Post
by ms_dos10 » Mon Feb 19, 2007 3:55 pm
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
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Feb 19, 2007 4:00 pm
"php" is the name of the executable.
ms_dos10
Forum Commoner
Posts: 42 Joined: Tue Jul 25, 2006 8:10 am
Post
by ms_dos10 » Mon Feb 19, 2007 4:06 pm
no name the folder where php is there i have to specified the whole path , is that right or no
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Mon Feb 19, 2007 5:02 pm
~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
ms_dos10
Forum Commoner
Posts: 42 Joined: Tue Jul 25, 2006 8:10 am
Post
by ms_dos10 » Thu Feb 22, 2007 5:52 pm
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