How to run a php script in command line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maheswaran
    New Member
    • Mar 2007
    • 190

    How to run a php script in command line

    Hi all,

    I want to install the horde mail server and am using xampp.

    See this



    In this installation instruction tells to run the php script in command line, i do not know how to any one can reply?.

    To run in command line.

    "C:\xampp\php\p hp.exe C:\xampp\htdocs \horde\scripts\ setup.php"
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Open your command line by going to Run -> then type 'cmd' and hit enter. It'll bring up the terminal.

    Comment

    • maheswaran
      New Member
      • Mar 2007
      • 190

      #3
      HI ,

      Could explain little bit, because am tried with that one but not get succeed,Click image for larger version

Name:	untitled.jpg
Views:	1
Size:	11.8 KB
ID:	5409784

      only shows its not a external or internal command.

      also tried with some php commanda, pls explain how to run...

      Comment

      • numberwhun
        Recognized Expert Moderator Specialist
        • May 2007
        • 3467

        #4
        Originally posted by maheswaran
        HI ,

        Could explain little bit, because am tried with that one but not get succeed,[ATTACH]1821[/ATTACH]

        only shows its not a external or internal command.

        also tried with some php commanda, pls explain how to run...
        First, that image is WAY too small for even me with my great eye-sight, to read. Second, if you are getting that error, I would say that the php.exe program is not installed. You need to check that it exists.

        Also, next time, please post the actual error(s) and the command line that you used.

        Regards,

        Jeff

        Comment

        • maheswaran
          New Member
          • Mar 2007
          • 190

          #5
          Hi ,

          Yes i have php.exe in my xampp/php folder.

          I have the xampp in D:/Program Files/Xampp

          and i run the command as below

          c:/

          c: / D:/Program files/xampp/php/exe D:/Program files/xampp/horde/scripts/setup.php
          also tried with back slashes

          c: / D:\Program files\xampp\php \exe D:\Program files\xampp\hor de\scripts\setu p.php

          but only i got 'D:\Program' is not recognized as an internal or external command,operabl e program or batch file

          and do not know why my attachment looking so small even i have modifed width into 1024 px

          See here

          Comment

          • maheswaran
            New Member
            • Mar 2007
            • 190

            #6
            Hi Guys,

            Finally i got, what am missing is "", i must run likw

            c:/ "D:/program files/xampp/php/php.exe" "D:/program files/xampp/htdocs/scripts/setup.php"

            Thanks for supprting...

            May above one is will use some one like me

            Comment

            • numberwhun
              Recognized Expert Moderator Specialist
              • May 2007
              • 3467

              #7
              Originally posted by maheswaran
              Hi Guys,

              Finally i got, what am missing is "", i must run likw

              c:/ "D:/program files/xampp/php/php.exe" "D:/program files/xampp/htdocs/scripts/setup.php"

              Thanks for supprting...

              May above one is will use some one like me
              If you are running windowsXP, then it does support tab-complete on the command line. This is where you would type: d:\Prog and then hit the tab key. You would then see that "Program Files" is enclosed in double quotes. This is the way you have to execute a program that has directories in its path that have spaces in them. If you put the php.exe program in say c:\test\php.exe you wouldn't have needed the double quotes.

              Ok, Windows command line lesson done.

              Regards,

              Jeff

              Comment

              Working...