470,848 Members | 1,216 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

executing PHP program in console???

bnp
Hi All,

I am beginner to PHP.
I read that you can run PHP program in a console window.
How can I do that?

Please help me

Bhavik
Jul 17 '05 #1
3 14907
In <7d*************************@posting.google.com> , bnp wrote:
I read that you can run PHP program in a console window.
How can I do that?


Start with reading manual.
http://www.php.net/manual/en/features.commandline.php

--
Sławek Pukło
Jul 17 '05 #2
Slawek Puklo wrote:
In <7d*************************@posting.google.com> , bnp wrote:
I read that you can run PHP program in a console window.
How can I do that?

Start with reading manual.
http://www.php.net/manual/en/features.commandline.php


Or do the following!!!

Windows:

Make sure the /folder.to/php.exe in your path so php.exe can be called
from any folder on your system....

For windows normally: c:\php\
For Unix/Linux /usr/local/bin (at least on my MDK system)

Then do this in console:
$ php filename.php

If you need more command-line options (for Unix/Linux) do:

$ php --help

Jul 17 '05 #3
"Mark Kuiphuis" <maluka@remove_this.koekeloekoe.nl> wrote in message
news:c8**********@reader08.wxs.nl...
Slawek Puklo wrote:
In <7d*************************@posting.google.com> , bnp wrote:
I read that you can run PHP program in a console window.
How can I do that?

Start with reading manual.
http://www.php.net/manual/en/features.commandline.php


Or do the following!!!

Windows:

Make sure the /folder.to/php.exe in your path so php.exe can be called
from any folder on your system....

For windows normally: c:\php\
For Unix/Linux /usr/local/bin (at least on my MDK system)

Then do this in console:
$ php filename.php

If you need more command-line options (for Unix/Linux) do:

$ php --help

Or in UNIX/Linux create your script with shbang:
#!/path/to/php -q
<?php
do_your_stuff();
?>
../filename[.php]
Make sure you chmod +x to your script.
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Justine | last post: by
15 posts views Thread by Chakkaradeep | last post: by
9 posts views Thread by Mads W. | last post: by
1 post views Thread by ronaldgranados | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.