PHP4 and Apache2 and Windows XP - no success yet

Posted on 2004-11-04
Last Modified: 2010-03-04
Hi all,

I installed PHP4 and Apache 2 on my Windows XP machine, I created phptest.php file which contains
<? phpinfo(); ?>

But when I click on that WExplorer just wants to either open it or save it.

Obviously it does not process the file as PHP file.

Can you plz help?


Question by:vladobb
    LVL 12

    Expert Comment


    in your httpd.conf, you need to set your documentRoot directory, this is where all your PHP files should sit under.
    DocumentRoot "C:/Program Files/Apache/Apache2/htdocs"

    and also setup your # To use server-parsed PHP files
    AddType application/x-httpd-php .php .php3 .php4 .phtml

    Expert Comment

    If you are using php as a module rather than cgi you also need to add a line like this one:

    LoadModule php4_module "c:/path/to/php/sapi/php4apache2.dll"

    You can put it with the other LoadModule lines.
    If you used the executable installer from (instead of the zip version) then you are using CGI and can disregard my post :)
    LVL 9

    Accepted Solution

    do check again pls
    In order to enable PHP to run on Apache
    To enable php on apache
    Open your httpd.conf file and look for the following lines:
    LoadModule php4_module  
    The above line loads the module.  Then you also need to have a line to tell it to process the .php file.  The line for this is:
    AddType application/x-httpd-php .php
    There should be sections for each of these lines.  
    The AddType line is usually present, but commented (#) out.
    You can also add more extensions that you want to process as well, like .php .php3 .php4 etc.
    After adding these lines you need to restart your apache server.  
    Good Luck
    LVL 9

    Expert Comment

    check out another good resources for PHP

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Apache server crashes randomly 38 105
    Nginx CDN 12 102
    Duplicate Records In MySQL 7 44
    local dns 2 93
    In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting ( to http…
    As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now