0

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.

2
  • Are you using mod_php or CGI? What does phpinfo(); tell you for Server API?
    – DerfK
    Apr 18, 2011 at 20:53
  • @DerfK CGI/FastCGI
    – csi
    Apr 18, 2011 at 21:04

3 Answers 3

3

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.

1
  • 2
    It's 100% permitted, and encouraged if none of the other answers were appropriate. You can even give yourself the tick. Apr 20, 2011 at 0:38
0

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

2
  • 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?
    – csi
    Apr 18, 2011 at 20:15
  • I misread your post. My answer is wrong. Apr 18, 2011 at 20:52
0

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

1
  • htaccess is allowed into that directory. Thanks though.
    – csi
    Apr 19, 2011 at 19:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .