Keeping window open after running php file from the command line?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jrf[no]

    Keeping window open after running php file from the command line?

    Hi all,

    I was getting a 500 error and someone adviced me to run the php file
    from the command line to check what errors that would come up with.

    Great idea which I'd like to use, but when I use the Windows "run" box
    to do this, I see a window open and close so quickly that there's no way
    for me to read what's come up.

    How can I force the window to stay open after the program has finished ?

    Just in case it's needed, I run the tests on a Win XP machine with Apache.

    Thanks in advance,
    Juliette

  • Jeb Hunter

    #2
    Re: Keeping window open after running php file from the command line ?

    That's what the "DOS" /K switch is for.

    --

    "jrf[no]" <"jrf[no]"@[spam]jokeaday.net> wrote in message
    news:419573ea$0 $23087$ee9da40f @news.wanadoo.n l...[color=blue]
    > Hi all,
    >
    > I was getting a 500 error and someone adviced me to run the php file
    > from the command line to check what errors that would come up with.
    >
    > Great idea which I'd like to use, but when I use the Windows "run" box
    > to do this, I see a window open and close so quickly that there's no way
    > for me to read what's come up.
    >
    > How can I force the window to stay open after the program has finished ?
    >
    > Just in case it's needed, I run the tests on a Win XP machine with Apache.
    >
    > Thanks in advance,
    > Juliette
    >[/color]


    Comment

    • jrf[no]

      #3
      Re: Keeping window open after running php file from the command line?

      Jeb Hunter wrote:
      [color=blue]
      > That's what the "DOS" /K switch is for.
      >[/color]

      Hi Jeb,

      Thanks for your quick reply.

      Just wondering how to use it...

      If I enter the following in the run box, the window still closes:
      C:\apache\php\p hp.exe "I:\_Website\in dex.php?id=test ing" /K

      What am I doing wrong ?

      Thx again,
      Juliette

      Comment

      • Daniel Tryba

        #4
        Re: Keeping window open after running php file from the command line ?

        jrf[no] <"jrf[no]"@[spam]jokeaday.net> wrote:[color=blue]
        > If I enter the following in the run box, the window still closes:
        > C:\apache\php\p hp.exe "I:\_Website\in dex.php?id=test ing" /K
        >
        > What am I doing wrong ?[/color]

        Start a command shell first (cmd IIRC) or take a look at the start
        command.

        Comment

        • jrf[no]

          #5
          Re: Keeping window open after running php file from the command line?

          Daniel Tryba wrote:
          [color=blue]
          > jrf[no] <"jrf[no]"@[spam]jokeaday.net> wrote:
          >[color=green]
          >>If I enter the following in the run box, the window still closes:
          >>C:\apache\php \php.exe "I:\_Website\in dex.php?id=test ing" /K
          >>
          >>What am I doing wrong ?[/color]
          >
          >
          > Start a command shell first (cmd IIRC) or take a look at the start
          > command.[/color]


          Hmm... I guess I'm too much of a newbie at running php through the
          command line to understand what you mean...

          Could you give me some examples maybe ? or point me to some webpages
          with more information on running php through the command line on windows ?
          I looked at the php manual but the information there doesn't seem to
          answer my question.

          Thx, Juliette

          Comment

          • Anonymous

            #6
            Re: Keeping window open after running php file from the command line?

            "jrf[no]" wrote:[color=blue][color=green]
            > > Start a command shell first (cmd IIRC) or take a look at the start
            > > command.[/color]
            >
            > Hmm... I guess I'm too much of a newbie at running php through the
            > command line to understand what you mean...[/color]

            In the run box you just have to enter "cmd".

            A command window will open and there you enter

            C:\apache\php\p hp.exe "I:\_Website\in dex.php?id=test ing"

            The window will stay open until you manually close it.

            Comment

            • jrf[no]

              #7
              Re: Keeping window open after running php file from the command line?

              Anonymous wrote:
              [color=blue]
              > "jrf[no]" wrote:
              >[color=green][color=darkred]
              >>>Start a command shell first (cmd IIRC) or take a look at the start
              >>>command.[/color]
              >>
              >>Hmm... I guess I'm too much of a newbie at running php through the
              >>command line to understand what you mean...[/color]
              >
              >
              > In the run box you just have to enter "cmd".
              >
              > A command window will open and there you enter
              >
              > C:\apache\php\p hp.exe "I:\_Website\in dex.php?id=test ing"
              >
              > The window will stay open until you manually close it.[/color]


              Ok, thanks for the advice.

              Question remains then: why don't I see anything when I've done that, no
              messages, nothing but a new prompt....

              I entered something that should give a 500 and so should throw some php
              errors...

              Help very welcome....

              Thx, Juliette

              Comment

              • Daniel Tryba

                #8
                Re: Keeping window open after running php file from the command line?

                jrf[no] <"jrf[no]"@[spam]jokeaday.net> wrote:[color=blue]
                > Question remains then: why don't I see anything when I've done that, no
                > messages, nothing but a new prompt....
                >
                > I entered something that should give a 500 and so should throw some php
                > errors...[/color]

                This is absolutely not necessary. PHP can do a silent fail.

                So you get get no output whatsoever running the phpscript from the
                commandline? Next step would be to check the returnvalue from php.exe (I
                have no idea where that is stored in win32) and run the script in a
                debugger. But since you had problems opening a commandline I don't think
                you are ready for this level of programming :)



                Comment

                • Simon Stienen

                  #9
                  Re: Keeping window open after running php file from the command line ?

                  "jrf[no]" <jrf[no]@[spam]jokeaday.net> wrote:[color=blue]
                  > How can I force the window to stay open after the program has finished ?[/color]

                  Sending output to STDERR should do the trick...
                  --
                  Simon Stienen <http://dangerouscat.ne t> <http://slashlife.de>
                  »What you do in this world is a matter of no consequence,
                  The question is, what can you make people believe that you have done.«
                  -- Sherlock Holmes in "A Study in Scarlet" by Sir Arthur Conan Doyle

                  Comment

                  Working...