Jump to content

Doesn't like index.php for main page


RogerInHawaii

Recommended Posts

I've built a website and some of the pages are php pages (e.g. SomePage.php). It all works fine; both the html pages and the php pages come up and work just fine.

 

I then made a change to the main index.html file and made it so that it's an index.php file instead, and it has some php code embedded in it, not much different than any of the other php pages on my site.

 

But when I try to go to that index.php file, as the first file to bring up for the site, it fails to bring up the page but instead pops up an Open File dialog, asking if I want to Open or Save the index.php file. It's as if the server is not recognizing index.php as being a php file that needs the normal php pre-processing on the server side. I used to get similar prpoblems with the other php pages before I had my server properly set up with Apache and php and such. But all of that is indeed properly set up. The OTHER php pages come up OK. It's just the very first, index.php page, that doesn't come up correctly.

 

What am I doing wrong?

 

Is there a standard way for making it bring up the first page as a php file? ???

Link to comment
https://forums.phpfreaks.com/topic/55198-doesnt-like-indexphp-for-main-page/
Share on other sites

RE: configure Apache to look for index.php as one of the default home pages

 

That does not sound familiar. I just installed and set up Apache last week and I don't recall anything like a specification for "default home pages". Of course, at the time I was installing I hadn't encountered this problem so default home pages would not have been on my mind. I am VERY new to all of this. If you can tell me how I might now specify to Apache what the default home pages should be, I'd be very grateful.

 

- Roger

 

what webserver are you using?

 

For Apache 1.3

open you apache.conf

 

#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
    DirectoryIndex index.html index.htm index.shtml default.htm default.html index.php
</IfModule>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.