php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15290 DirectoryIndex -> index.php must come first
Submitted: 2002-01-29 23:08 UTC Modified: 2002-04-09 17:12 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: swade at diamondhill dot com Assigned:
Status: Not a bug Package: *Web Server problem
PHP Version: 4.1.1 OS: rh 7.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
39 + 33 = ?
Subscribe to this entry?

 
 [2002-01-29 23:08 UTC] swade at diamondhill dot com
not a typical setup...i'm developing on a vmware virtual machine....but everything else has been flawless so maybe this isn't related to that. latest versions of all, apache, php, samba

When listing
DirectoryIndex index.html index.php 
in apache 

on a smb mounted share aka my scripts are physically on an xp shared folder, I mount the share using smbmount the folder as a linux directory which is setup as apaches directory. I've noticed if I list index.php AFTER index.html that if i edit the index.php file on xp, the changes will not be seen by the webserver. However it is only with a file named index.php, all other filenames work fine. Wierd huh? however if I list index.php first before index.html everything works perfectly.

Additionally, umounting the share and remounting doesn't fix, only listing index.php first in directoryindex

Not sure if this happens outside of a virtual machine or a non smb share, but it was a $#$ tracking down. reinstalled samba & more. 

I had previously been using the 4.06 version and this didn't happen. 

Like I said not sure if is some wierd interaction with the virtual machine or mounting the share but thought Id pass it on in case it wasn't related, as its reproducable on my end...I also tried different server directories i had setup and it occured on those also.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-30 02:30 UTC] cardinal@php.net
Just to get one easy thing out of the way, you don't have
an index.html file in the directory, do you?

Naturally, index.php must be first in the DirectoryIndex list
if you want it to be displayed in a directory which contains
both an index.html and an index.php
 [2002-01-30 02:55 UTC] derick@php.net
Just wanted to add that Samba might cache files, and thus updating it has no effect.

Derick
 [2002-01-30 03:27 UTC] swade at diamondhill dot com
No, theres no index.html.

I just did some more checking, 

I unmounted the xp share and ftp'd the files to a hard dir on linux vm
then edited index.php via vi, the file matched the webrowser. everything  is ok here.

I reswitched back to shared setup and restarted apache
edited the file on nt
change didn't show via http (after first load) nor does the file change show via vi,cat or more. but if I closed the file on xp and reopened  on xp the actual file is changed on xp.

So its like some  interaction between apache,php and the mounted share that caused smbmount,smbfs,samba,etc to not update -its- version of the file it has mounted on xp...with that apache directive...only index.php file exibits this behavior when set that way.

I checked and the smbmount is still there and no crash of the mount.smb program and smb log shows nothing.

Next I reswtiched back the index.php as first in httpd.conf DirectoryIndex
restarted the webserver, and still the change didn't show until i resaved the file
then of course everything works normally after that.

Its a wierd setup I know. I dont have a box handy to test it with a share outside of vmware...but I didn't notice it until upgrading php. It's not a big deal, I doubt to many people run a mounted share on xp,  I only do it during development so thats the only reason i noticed it.
 [2002-01-30 03:36 UTC] swade at diamondhill dot com
I thought caching issue too at first, but then if that was the case it would affect other files besides one named index.php. But only a file named index.php listed in that order in DirectoryIndex exibits that behavior.  The fix is simple enough though...
 [2002-04-09 17:12 UTC] jimw@php.net
if, as you say, the change does not show up with other programs like vi and cat, it certainly sounds like an issue between samba and windows xp. (yes, the whole directoryindex thing is strange. it probably just triggers some access pattern that inadvertantly avoids the issue.)
 [2004-06-16 00:57 UTC] dan dot bell at londonlink dot net
Check the DirectoryIndex in /etc/httpd/conf.d/php.conf.  These settings will take precedence over the httpd.conf file.  Add your preferred settings into the php.conf and restart Apache.

Dan Bell
LondonLink
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 08:02:42 2024 UTC