index.php files ignored

Mark Hattam mark at dxradio.demon.co.uk
Fri Mar 18 16:02:07 PDT 2011


On 18 Mar 2011, at 19:11, Tony Miller wrote:

> On Mar 18, 2011, at 1:44 PM, Mark Hattam wrote:
> 
>> On 18 Mar 2011, at 18:08, Tony Miller wrote:
>> 
>>> I am a first-time MacPorts user and have a new favorite upgrade method for my Mac OS machines. I have been struggling with PCI compliance for an ecommerce machine. I am running a G5 1.8Ghz/PPC OS X 10.5.8 Server and followed the HowTo/MAMP - MacPorts instructions. After the install, I did some tweaking to the SSL config files, virtual host configs and it now passes PCI compliance scans with Apache 2.2.17, MySQl 5.2.x, and PHP 5.3.5. 
>>> 
>>> The server recognizes index.html files as default DirectoryIndex files, but will not find or recognize index.php files the same way. It also will load index.tpl and default.tpl (WebDNA) files with no problem. 
>>> 
>>> If I input the entire manual path to the files, ex: http://www.domain.com/siteroot/index.php, the site will load and php works fine. If I try to load the site using the DNS name for the site, ex: http://www.mysite.com/ it fails to acknowledge there is an index.php file in the root of the directory and redirects to the default site for the apache server. 
>>> 
>>> I double-checked that I did all the steps in the install regarding loading the modules and adding the types and other config changes, but it won't load .php files. I've tried adding 'DirectoryIndex index.php index.html' to the .htaccess file in the siteroot and apache webroot and no change. 
>>> 
>>> When it do a phpinfo the results in the PHP it reports 'Virtual Directory Support = disabled'. Is there an option that I should have used to enable virtual directory support when I complied php? If so, does anyone know what that option is and can I simply reinstall php with the virtual option to remedy this issue? 
>>> 
>>> I didn't install the phpmyadmin as I use CocoaMySQL and it said it was optional. Would there be something in that part that would have finished install to allow this to work properly? 
>>> 
>>> Thanks for any help in advance. I'm sure it's something silly I'm missing. 
>>> 
>>> Tony Miller
>>> tmiller at thehawkeye.com
>> 
>> 
>> Hi Tony
>> 
>> Unless you've specifically enabled your Apache2 to use .htaccess files, then it won't be using them.
>> 
>> Better anyway is to have in your httpd.conf the following
>> 
>> <IfModule dir_module>
>>   DirectoryIndex index.php index.html index.cgi
>> </IfModule>
>> 
>> It'll serve up a index.php as a first option, if not then a index.html and so on.
>> 
>> Then restart Apache to pick up the change.
>> 
>> Mark
>> 
> 
> Thanks Mark,
> 
> I have those lines in the httpd.conf file;
> 
> <IfModule dir_module>
>   DirectoryIndex "index.php" "index.html"
> </IfModule>
> 
> Are the quote marks not needed and could they be mucking up the works? 
> 
> Tony


Well, I've never used quote marks here, and it works.

The manual also doesn't show quote marks
http://httpd.apache.org/docs/2.2/mod/mod_dir.html

Does your apache error log have anything relevant?

Mark


More information about the macports-users mailing list