Apache does not grab index.php

Posted on 2004-11-18
Last Modified: 2012-08-14
I configured apache to use files with extension *.php. For some reason when i point to folder, Apache does not take and display index.php automaticly. I have to scroll dawn list of files in folder to find index.php.
How to make apache server to grab index.php automaticly whenever i point to that folder.
Here are steps i did take when configuring php with apache.
By the way i am runing apache and php 4-3-8 win32 on 2000 Server
1. Renamed php.ini-dist to php.ini and copy in C:\WINNT folder
2. Copy php4ts.dll into C:\program files\....\Apache2\bin(just did it, it wasn't, but still not working after restart of apache server)
3.Add three lines of AddType:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
added -> AddType application/x-httpd-php .php
added -> AddType application/x-httpd-php .php3
added-> AddType application/x-httpd-php-source .phps
4. add one line of:
#LoadModule vhost_alias_module modules/
#LoadModule ssl_module modules/
LoadModule php4_module c:/php/sapi/php4apache2.dll
(php4apache2.dll is in path c:/php/sapi path)

And it is still not working.
Any Ideas?
Question by:margotsk
    LVL 48

    Accepted Solution

    Hi margotsk,
    add also

    DirectoryIndex index.php

    to you config (after teh AddType)

    LVL 38

    Assisted Solution

    check you http.conf file to make sure:

    <IfModule mod_dir.c>
    #    DirectoryIndex index.html
        DirectoryIndex index.html index.php index.php3 index.php4 index.htm index.shtml index.cgi

        # And for PHP 4.x, use:
        AddType application/x-httpd-php .php

    see http:Q_20849983.html

    for more details

    Author Comment

    Thank's it works now.
    Both of your answers work. I will give hernst42 150, since it solves the major problem and 100 pt to yuzh for adding additional info in better understaning.
    I hope that's Ok, if not, please let me know
    LVL 38

    Expert Comment

    No problem with me, fair enough.


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
    If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
    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…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    729 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

    19 Experts available now in Live!

    Get 1:1 Help Now