By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

When I run a PHP script the result displays in a DOS Window instead of browser

P: n/a
I have both PHP and Apache installed on my Windows machine.

When I open up a PHP script file in my browser, the output goes to a
DOS Window (and the window closes immediately upon completion of the
script).

Can anyone tell me how I can get the script output to display in the
browser?

Thanks; appreciate your help.

M. McDonnell

May 26 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On May 26, 11:45 am, Michael <MichaelDMcDonn...@yahoo.comwrote:
I have both PHP and Apache installed on my Windows machine.

When I open up a PHP script file in my browser, the output goes to a
DOS Window (and the window closes immediately upon completion of the
script).

Can anyone tell me how I can get the script output to display in the
browser?

Thanks; appreciate your help.

M. McDonnell
Looks like I need to run in the localhost directory to make in run in
the browser, correct?

May 26 '07 #2

P: n/a
On 26 May 2007 11:45:31 -0700, Michael <Mi***************@yahoo.comwrote:
>I have both PHP and Apache installed on my Windows machine.

When I open up a PHP script file in my browser, the output goes to a
DOS Window (and the window closes immediately upon completion of the
script).

Can anyone tell me how I can get the script output to display in the
browser?
What are you doing, just opening the file off the filesystem? That's not how
it works - you need to configure Apache to run PHP, and access the pages
through your local Apache - most likely as http://localhost/.

Start here: http://www.php.net/manual/en/install...ws.apache2.php

... and bear in mind you want to run as an "Apache module" and not as a "CGI
binary", so pick the bits of the documentation above appropriately.
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
May 26 '07 #3

P: n/a
On May 27, 1:58 am, Michael <MichaelDMcDonn...@yahoo.comwrote:
On May 26, 11:45 am, Michael <MichaelDMcDonn...@yahoo.comwrote:
I have both PHP and Apache installed on my Windows machine.
When I open up a PHP script file in my browser, the output goes to a
DOS Window (and the window closes immediately upon completion of the
script).
Can anyone tell me how I can get the script output to display in the
browser?
Thanks; appreciate your help.
M. McDonnell

Looks like I need to run in the localhost directory to make in run in
the browser, correct?
Yup, In the webroot folder(or any sub folder of it) of your web
server. For apache, webroot is 'htdocs' directory. It's worth saying
that if PHP is your first web programming language, you have to study
web server basics too.

Can't help criticizing you though. When you fall into any problem you
should first google it. And as you are new to a language which is
vastly popular, you should just try "php beginners tutorial" or "php
basic tutorial" in google. My goal is not to have a bash at you,
rather remind you that best way to learn is learning how to learn at
first. I hope it helps you. And some links for you.

http://www.php.net/tut.php
http://www.phpfreaks.com/tutorials.php
http://wamp.corephp.co.uk/
http://www.howtoforge.com/php_programming_basics

May 26 '07 #4

P: n/a
Michael wrote:
I have both PHP and Apache installed on my Windows machine.

When I open up a PHP script file in my browser, the output goes to a
DOS Window (and the window closes immediately upon completion of the
script).

Can anyone tell me how I can get the script output to display in the
browser?

Thanks; appreciate your help.

M. McDonnell
I'd suggest you just get XAMPP or similar and install it with "single
click" like every decent windows user is supposed to do. ;)

--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
May 26 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.