how can i use php from command line ? step

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

how can i use php from command line ? step

Post 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
Mightywayne
Forum Contributor
Posts: 237
Joined: Sat Dec 09, 2006 6:46 am

Post by Mightywayne »

.. 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 »

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 ?
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

ms_dos10
Forum Commoner
Posts: 42
Joined: Tue Jul 25, 2006 8:10 am

Post by ms_dos10 »

i read all this be for but i don't get anything from it
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

what don't you understand?
ms_dos10
Forum Commoner
Posts: 42
Joined: Tue Jul 25, 2006 8:10 am

Post 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 ?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

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 »

You type "php" (provided it's in your path) followed by some arguments...
which arguments ?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

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 »

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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

"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 »

no name the folder where php is there i have to specified the whole path , is that right or no
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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
ms_dos10
Forum Commoner
Posts: 42
Joined: Tue Jul 25, 2006 8:10 am

Post 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
Post Reply