By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,977 Members | 1,369 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,977 IT Pros & Developers. It's quick & easy.

Using PHP on home page, index.php not working

P: 13
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 problems (popping up the Open File dialog) 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?

[ I had posted this yesterday but somehow it disappeared from the forum.]
Jun 12 '07 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 134
have you checked that there are no whitespaces in the .php extension? (know this sounds stupid, but sometimes they sneak in anyways)

You're running apache and php right?

i guess you have setup index.php in the DirectoryIndex setting in httpd.conf....
Jun 12 '07 #2

Expert 2.5K+
P: 3,235
Do you have PHP installed on the server?
Care to post your PHP code?
Jun 12 '07 #3

Expert 5K+
P: 5,821
Make sure you have the following lines in your httpd.conf file:

Expand|Select|Wrap|Line Numbers
  1. LoadModule php5_module        modules/
  2. AddType application/x-httpd-php .php
Jun 14 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.