f



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

0
jrf
11/13/2004 2:41:22 AM
comp.lang.php 32646 articles. 0 followers. Post Follow

8 Replies
1292 Views

Similar Articles

[PageSpeed] 36

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.nl...
> 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
>


0
jebhunter (8)
11/13/2004 3:05:27 AM
Jeb Hunter wrote:

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

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\php.exe "I:\_Website\index.php?id=testing" /K

What am I doing wrong ?

Thx again,
Juliette
0
jrf
11/13/2004 3:12:42 AM
jrf[no] <"jrf[no]"@[spam]jokeaday.net> wrote:
> If I enter the following in the run box, the window still closes:
> C:\apache\php\php.exe "I:\_Website\index.php?id=testing" /K
> 
> What am I doing wrong ?

Start a command shell first (cmd IIRC) or take a look at the start
command.
0
spam206 (250)
11/13/2004 3:31:37 AM
Daniel Tryba wrote:

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


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
0
jrf
11/13/2004 3:49:38 AM
"jrf[no]" wrote:
> > Start a command shell first (cmd IIRC) or take a look at the start
> > command.
> 
> Hmm... I guess I'm too much of a newbie at running php through the
> command line to understand what you mean...

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

A command window will open and there you enter

C:\apache\php\php.exe "I:\_Website\index.php?id=testing"

The window will stay open until you manually close it.
0
11/13/2004 5:45:37 AM
Anonymous wrote:

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


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
0
jrf
11/13/2004 2:06:01 PM
jrf[no] <"jrf[no]"@[spam]jokeaday.net> wrote:
> 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...

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 :)



0
spam206 (250)
11/13/2004 2:27:33 PM
"jrf[no]" <jrf[no]@[spam]jokeaday.net> wrote:
> How can I force the window to stay open after the program has finished ?

Sending output to STDERR should do the trick...
-- 
Simon Stienen <http://dangerouscat.net> <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
0
11/26/2004 1:47:40 AM
Reply: