SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem running php on windows

    Hello
    I'm having a problem running php files on windows. I'm using php5 and apache 2.2.x
    the testing page returns :

    <?php phpinfo(); ?>

    so the code is not executing.
    I would like to get a help on that, I'm new to php

    Thank you

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,036
    Mentioned
    187 Post(s)
    Tagged
    2 Thread(s)
    The server needs to be running
    The file should have the ".php" extension* - and -
    the server should have a directive indicating that files with the ".php" extension* should be parsed by the PHP parser.
    (*technically the server can PHP parse any extension it's configured to, just that .php is the "default")
    Are all these true for you?

  3. #3
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The server is running, OK...
    the file should have the .php extension, OK...
    am not sure about the 3rd one.


    Quote Originally Posted by Mittineague View Post
    The server needs to be running
    The file should have the ".php" extension - and -
    the server should have a directive indicating that files with the ".php" extension should be parsed by the PHP parser.
    Are all these true for you?

  4. #4
    SitePoint Zealot
    Join Date
    May 2006
    Location
    Jhyalipati,Chapagaun-9, Lalitpur, Bagmati, Nepal
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you haven't configured the server properly. please follow the manual</a> i think you found the solution
    Simply Sajan

  5. #5
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,036
    Mentioned
    187 Post(s)
    Tagged
    2 Thread(s)
    I use the XAMPP package, so my config is probably different, but in your httpd.conf file look for the section
    Code:
    <IfModule mime_module>
    there may be a line(s) for PHP commented out with a hash # in which case you can uncomment it/them. Otherwise try adding
    Code:
    LoadModule php4_module c:/apache/php/sapi/php4apache.dll
    AddType application/x-httpd-php .php
    You may not need the dll line, but if you do it will be different for version 5

    Make sure you save a backup of the original file. If you mess things up you will need it.

  6. #6
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GOOD: I have XAMPP 1.6.7 running under Windows XP.
    GOOD: The control panel reports Apache and MySQL are RUNNING.
    GOOD: Port check corroborates that opinion. It didn't always do that, what with Skype getting to Port 80 first.
    GOOD: Firefox responds "It works" when fed index dot [whatever]
    BAD: Firefox responds, "Something's wrong" when given index dot php.
    BAD: Entering CD \XAMPP\PHP results in C:\XAMPP\PHP>, that's fine, but after Norton finishes squawking about PHP-WIN wanting to connect to a DNS server, the C:\XAMPP\PHP> prompt returns. Dang. Subsequent PHP-WIN commands merely end up putting another blank line in the DOS window.
    BAD: Just for jollies i entered "PHP." At least that was an improvement: the prompt went away entirely.
    Clearly I'm missing a piece of the puzzle.
    Anyone know what it might be?

  7. #7
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,036
    Mentioned
    187 Post(s)
    Tagged
    2 Thread(s)
    Hi david_usa, welcome to the forums,
    Once you start things up. You should be able to use your browser to go to
    http://localhost/whatever.whatever as long as the whatever.whatever file is in the htdocs folder. AFAIK, there is no need to CD with the DOS prompt.

  8. #8
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It works
    Thank you guys


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •