Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm just trying to setup some simple things. I put an index.php file in my documentroot. index.html works just fine (sends a webpage). If I try index.php, it assumes I'm trying to download it. How do I know if php is working on apache? Where should I look?

share|improve this question
    
What system are you running this on? –  Karol Piczak Apr 25 '10 at 18:21

1 Answer 1

up vote 3 down vote accepted

That will usually happen if you haven't added a handler to tell apache what to do with .php files. In your apache configuration file, you should have a line like:

LoadModule php5_module modules/libphp5.so

which actually loads the module, Then you'll need something like

AddHandler php5-script .php
AddType text/html .php

To actually associate php files. Additionally, you can add:

DirectoryIndex index.php

which will treat index.php the same as index.html.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.