executing PHP program in console???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bnp

    executing PHP program in console???

    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
  • Slawek Puklo

    #2
    Re: executing PHP program in console???

    In <7d72bcc.040517 0515.54fd8e21@p osting.google.c om>, bnp wrote:[color=blue]
    > I read that you can run PHP program in a console window.
    > How can I do that?[/color]

    Start with reading manual.


    --
    S³awek Puk³o

    Comment

    • Mark Kuiphuis

      #3
      Re: executing PHP program in console???

      Slawek Puklo wrote:[color=blue]
      > In <7d72bcc.040517 0515.54fd8e21@p osting.google.c om>, bnp wrote:
      >[color=green]
      >>I read that you can run PHP program in a console window.
      >>How can I do that?[/color]
      >
      >
      > Start with reading manual.
      > http://www.php.net/manual/en/features.commandline.php
      >[/color]

      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

      Comment

      • Neters Landreau

        #4
        Re: executing PHP program in console???

        "Mark Kuiphuis" <maluka@remove_ this.koekeloeko e.nl> wrote in message
        news:c8ahrj$16s $1@reader08.wxs .nl...[color=blue]
        > Slawek Puklo wrote:[color=green]
        > > In <7d72bcc.040517 0515.54fd8e21@p osting.google.c om>, bnp wrote:
        > >[color=darkred]
        > >>I read that you can run PHP program in a console window.
        > >>How can I do that?[/color]
        > >
        > >
        > > Start with reading manual.
        > > http://www.php.net/manual/en/features.commandline.php
        > >[/color]
        >
        > 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
        >[/color]
        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.


        Comment

        Working...