-3

Possible Duplicate:
How to configure php5 on apache2.2?

I have bought new apache server 142.4.4.15
It opens up index.html but cannot open index.php
I have php, apache and mysql installed on to it.
Apache status showing working fine.... Is their any php configuration I am missing out in Apache...

Please help me.....

Wazzzy
  • 147
  • 1
  • 6

2 Answers2

2

In you apache conf file probably located in

/etc/httpd/conf/httpd.conf 

You need to make sure you have this line:

DirectoryIndex index.html index.php

if not add the index.php and restart apache.

You also need to make sure you have:

Include /etc/httpd/mod_php.conf 

or whatever path it is in.

Also while in there you may want to turn off server tokens. It will add an extra layer of security.

Also check permissions on your index.php file to make sure they match the owner and system privileges. If not then chown and chmod the file appropriately.

All these edits will require a httpd restart.

J Baron
  • 338
  • 1
  • 7
  • Thanks....BUT It is asking me for download....instead of displaying....Please help...I made all the changes in `.htaccess` instead of `httpd.conf` .... – Wazzzy Oct 19 '12 at 15:53
  • 1
    Well you also need to make sure you have: Include /etc/httpd/mod_php.conf or whatever path it is in. If you don't have access to the confs you will need to get your server host to assist you with enabling it. Also while in there you may want to turn off server tokens. It will add an extra layer of security. All these edits will require a httpd restart. – J Baron Oct 19 '12 at 16:03
  • Thanks again...I tried to search for that file on my server...but it is not there.... – Wazzzy Oct 19 '12 at 16:09
  • 1
    Which file? httpd.conf or mod_php.conf?? Sounds like php may not be installed. it could be named php.conf or something similar.I'd need a lot more details about your server to go much farther. – J Baron Oct 19 '12 at 16:17
  • I could not find `mod_php.conf` but i do see `httpd.conf` file..... – Wazzzy Oct 19 '12 at 16:19
  • but i can run php from command line..... – Wazzzy Oct 19 '12 at 16:19
1

Seems like your Apache is missing PHP configuration, please refer to following article: PHP: Apache - Manual it explains what to do you to make your Apache to make it work w/ PHP.

alexus
  • 13,112
  • 32
  • 117
  • 174
  • Thanks for your answer....I appreciate that....Also I got my question to be Possible duplicate of....I am looking in to it...Thanks a lot.... – Wazzzy Oct 20 '12 at 04:49