Bug 92028 - DirectoryIndex index.php in php.conf overwritten by httpd.conf
Summary: DirectoryIndex index.php in php.conf overwritten by httpd.conf
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: php
Version: 9
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Joe Orton
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-05-31 21:25 UTC by Tomasz Ostrowski
Modified: 2007-04-18 16:54 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-06-02 09:28:48 UTC
Embargoed:


Attachments (Terms of Use)

Description Tomasz Ostrowski 2003-05-31 21:25:11 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030529

Description of problem:
DirectoryIndex index.php directive in php.conf file is overwritten by httpd.conf.

The comment "Add index.php to the list of files that will be served as directory
indexes." is untrue and misleading: DirectoryIndex directive overwrites list of
index files - not adds them. It's makes it hard to find the cause of not working
index.php.


Version-Release number of selected component (if applicable):
php-4.2.2-17

How reproducible:
Always

Steps to Reproduce:
1. Install php package with default httpd.conf.
2. Create directory /var/www/php
3. Create file /var/www/php/index.php with line
<?php phpinfo() ?>
4. Check page http://localhost/php/


Actual Results:  Directory index forbidden

Expected Results:  phpinfo() page

Additional info:

Comment 1 Joe Orton 2003-06-02 09:28:48 UTC
The DirectoryIndex list does accumulate, this sounds like a configuration or
permissions error.  Note that /var/www/php is not mapped into the URL space by
default; do you mean /var/www/html/php?

Comment 2 Tomasz Ostrowski 2003-06-02 11:38:40 UTC
Oops - it does accumulate in "server config" context but when set in "virtual
host" or "directory" context for the first time it's overwritten (second time
accumulate).

Try the following:
1. With clear system with httpd and php create /etc/httpd/conf.d/_localhost.conf:
        <VirtualHost localhost>
        ServerName localhost
        DocumentRoot /var/www/localhost
        DirectoryIndex index.htm
        </VirtualHost>
2. Create file /var/www/localhost/index.php:
        <?php phpinfo() ?>
3. apachectl restart
4. Check page http://localhost/

There's not a word about accumulating DirectoryIndex in Apache documentation
http://httpd.apache.org/docs-2.0/mod/mod_dir.html#directoryindex
I think this is unsupported feature. Maybe it was added by RedHat...

Comment 3 Joe Orton 2003-06-02 11:55:14 UTC
It's an undocumented feature, and it's worked like that in Apache httpd 1.3 for
quite a long time, we don't patch it in.  The current merging behaviour is
arguably correct, so we wouldn't patch it to change the behaviour.  Can you file
an enhancement request at:

http://nagoya.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2.0

Comment 4 Tomasz Ostrowski 2003-06-02 12:40:10 UTC
OK: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20414

Thanks.



Note You need to log in before you can comment on or make changes to this bug.