473,396 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 3079
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: BlackHawke | last post by:
Our program, game program Andromeda Online (www.andromedaonline.net) uses two programs- one to play the game, another to patch the game as updates come out. Players actually launch the updater...
0
by: Tom Dacon | last post by:
"Open .Net Command Window Here" context menu for Windows Explorer: The reg file described below adds a new menu item to Windows Explorer's context menu when you right-click over a folder (or the...
4
by: JeffP | last post by:
I want to add a short-cut to a windows app similar to launching from a windows run line a New window, to prevent changing an existing browser window from moving off a current logged in session...
1
by: Rob | last post by:
I'm running a batch file using the Shell function. When I manually launch the batch file, the window remains open, since I use the 'pause' statement. But when I launch the batch file within...
4
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a copy of the access database (creating a backup)...
5
by: somersbar | last post by:
i hav a project in visual basic.net which uses asp.net web forms to access a microsoft access database. i had fierce trouble getting it to access the database but fixed it by accident. basically i...
3
by: Andrew Poulos | last post by:
There's a HTA application that's running on a local computer (not from a URL) and the user can open a new HTML window by clicking a button The first time the user clicks the button the window...
0
by: stefburn | last post by:
Hello Folks, Okay so I'm running a server window to debug some issues. I can keep the server window open by going to the path and opening a command prompt at the path of the <server.exe> file...
1
by: SilverGS | last post by:
I want to automatically open a Command Window from the Startup folder in Windows XP. right now after XP starts, I click on Start run, cmd and then when the command window is open I type in a bunch...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.