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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael

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

    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

  • Michael

    #2
    Re: When I run a PHP script the result displays in a DOS Window instead of browser

    On May 26, 11:45 am, Michael <MichaelDMcDonn ...@yahoo.comwr ote:
    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?

    Comment

    • Andy Hassall

      #3
      Re: When I run a PHP script the result displays in a DOS Window instead of browser

      On 26 May 2007 11:45:31 -0700, Michael <MichaelDMcDonn ell@yahoo.comwr ote:
      >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 :: andy@andyh.co.u k :: http://www.andyh.co.uk
      http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

      Comment

      • skywriter14

        #4
        Re: When I run a PHP script the result displays in a DOS Window instead of browser

        On May 27, 1:58 am, Michael <MichaelDMcDonn ...@yahoo.comwr ote:
        On May 26, 11:45 am, Michael <MichaelDMcDonn ...@yahoo.comwr ote:
        >
        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.




        PHP Programming Basics This article is the first of a series of PHP guides that aim at teaching you the basics of PHP programming....


        Comment

        • gosha bine

          #5
          Re: When I run a PHP script the result displays in a DOS Window insteadof browser

          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

          Comment

          Working...