472,096 Members | 1,198 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,096 software developers and data experts.

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

Jul 17 '05 #1
8 2945
That's what the "DOS" /K switch is for.

--

"jrf[no]" <"jrf[no]"@[spam]jokeaday.net> wrote in message
news:41***********************@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

Jul 17 '05 #2
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
Jul 17 '05 #3
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.
Jul 17 '05 #4
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
Jul 17 '05 #5
"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.
Jul 17 '05 #6
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
Jul 17 '05 #7
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 :)

Jul 17 '05 #8
"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
Jul 17 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by BlackHawke | last post: by
4 posts views Thread by JeffP | last post: by
5 posts views Thread by somersbar | last post: by
3 posts views Thread by Andrew Poulos | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.