Page 1 of 1
Executing Php Files
Posted: Thu Apr 30, 2009 1:26 am
by s2009
How to execute PHP files?
Is apache server mandatory to be installed while working with PHP?
Please help me out with the above doubt.
Thanks in advance!!
Reply With Quote
Re: Executing Php Files
Posted: Thu Apr 30, 2009 1:42 am
by requinix
Command line: php -f filename
A web server is not necessary.
Re: Executing Php Files
Posted: Thu Apr 30, 2009 1:48 am
by s2009
Thanks a lot for ur prompt reply.
Which command prompt?
Is it Ms-Dos Command Prompt?
Because while installing php Designer 2008 i did not get any Command Prompt?
What should I do?
Please help me.
Re: Executing Php Files
Posted: Thu Apr 30, 2009 3:06 am
by requinix
Yes, the command prompt, but it doesn't have to be used that way.
You know Start -> Run? If PHP is installed to C:\PHP then you can run
Code: Select all
C:\PHP\php.exe -f [i]full path to your .php file[/i]
Re: Executing Php Files
Posted: Thu Apr 30, 2009 6:58 am
by s2009
Hi
When I open the file in the command prompt by doing the following:
Start---> Run
"C:\Program Files\phpDesigner 2008\PHP\php.exe"
It is displaying a empty command prompt window.
Now here in the empty window I type the following:
-f D:\AAA\one.php
Once I press enter nothing happens just the cursor is moved one step down.
Now What should I do to run the file?
Re: Executing Php Files
Posted: Thu Apr 30, 2009 7:04 am
by Mark Baker
Start---> Run
"C:\Program Files\phpDesigner 2008\PHP\php.exe -f D:\AAA\one.php"
If you don't have the -f etc on the same line, you're going into an interactive mode where PHP expects you to type in the code by hand in that "empty window"
Re: Executing Php Files
Posted: Thu Apr 30, 2009 7:07 am
by s2009
Thank you
Then should I write the entire coding over here?
If yes then after writing the coding how should I save it?
And how to execute it?
Please help me