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.

Seems easy, right? Done it a million times, right? Me too. For some reason this isn't working on an A2 hosting configuration. Anyone have any ideas?

In .htaccess in "/" directory

AddType application/x-httpd-php .html

test.php which is "Hello World" executes just fine. test.html downloads instead of parsing.

I have read lots of Q&As and no luck. What is missing? What other configs can I examine? Thanks.

share|improve this question
    
Are you using mod_php or CGI? What does phpinfo(); tell you for Server API? –  DerfK Apr 18 '11 at 20:53
    
@DerfK CGI/FastCGI –  Christopher Ickes Apr 18 '11 at 21:04
add comment

3 Answers

up vote 3 down vote accepted

I don't know if this is legal or not but I am responding to my own question so the answer is there for others to use in the future.

For some reason the default file permissions were all set to 777 or 666 which caused issues with them being served correctly. By adjusting the file permissions to 644, these issues were solved. Of course the .htaccess AddType was also required.

share|improve this answer
2  
It's 100% permitted, and encouraged if none of the other answers were appropriate. You can even give yourself the tick. –  Mark Henderson Apr 20 '11 at 0:38
add comment

Is the module loaded? E.g. LoadModule php5_module modules/libphp5.so

share|improve this answer
    
I added <IfModule !php5_module> # If the PHP5 module has NOT already been loaded, load it LoadModule php5_module modules/libphp5.so </IfModule> but that creates a server error. How else can I check if the module loaded? .php files work so I assume that it works? –  Christopher Ickes Apr 18 '11 at 20:15
    
I misread your post. My answer is wrong. –  Mark Wagner Apr 18 '11 at 20:52
add comment

look if .htaccess is allowed to be read into the directory you have it. into httpd.conf you will need to have AllowOverride for that location see http://httpd.apache.org/docs/2.0/howto/htaccess.html

share|improve this answer
    
htaccess is allowed into that directory. Thanks though. –  Christopher Ickes Apr 19 '11 at 19:16
add comment

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.