How to run command line from php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • peres232323
    New Member
    • Sep 2006
    • 4

    How to run command line from php

    Hi,
    How can i ran a command line from php file.
    I need to run "ant -<flag> <path> -<flag>"
    This should run on Windows XP.

    (I suucceded to run system command like ping.)


    Tahnks -:)
  • phpmaet
    New Member
    • Sep 2006
    • 27

    #2
    hi,

    In Windows,
    To run a PHP script on the command line, first open the command prompt (Start -> Run, 'cmd.exe').

    When you are in the correct directory, first enter the location to your php.exe, then a space, and then your script path name,

    c:\php>php c:\php\files\in dex.php

    Thanks

    Comment

    • peres232323
      New Member
      • Sep 2006
      • 4

      #3
      Originally posted by phpmaet
      hi,

      In Windows,
      To run a PHP script on the command line, first open the command prompt (Start -> Run, 'cmd.exe').

      When you are in the correct directory, first enter the location to your php.exe, then a space, and then your script path name,

      c:\php>php c:\php\files\in dex.php

      Thanks




      Thanks, but I don't need to run php from command line.
      I need to run a command line from php scripts.
      any suggestions?

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Do not ask the same question in 2 different threads!! There are other people waiting.

        Ronald :cool:

        Comment

        Working...