views:

72

answers:

1

I'm trying to replicate a web-site on a test-server. However, on the test-server, .php files don't get interpreted. I found that the cause is a .htaccess file in the document root. Its contents:

# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php
RewriteEngine On
#RewriteRule ^$ index.php [QSA]
RewriteRule ^(.*)$    /web/$1

How do I configure Apache2/PHP5 to support the handler application/x-httpd-php5s? Is there any software-package which makes this handler available?

Update: It may be a handler specific to Bluehost.com. Am currently investigating this...

Update 2: To avoid having to change the .htaccess file, which would introduce inconsistencies, I added a handler "application/x-httpd-php5s" to Apache:

AddHandler application/x-httpd-php5s .php
Action application/x-httpd-php5s /cgi-bin/php5

However, that handler will not behave as on the production server, where it causes the PHP interpreter to use a php.ini in the document root and use it for all subdirectories. A somewhat ugly workaround is, for example, to symlink that php.ini to the global php.ini on the test-server.

+2  A: 

AddHandler application/x-httpd-php5s is the source handler.

All you have to do is change it to AddHandler application/x-httpd-php5 .php

hopeseekr
I don't want to modify the web-site's code. And, also, I assume that your proposed change breaks functionality. There is a "php.ini" in the document root, and - if I understand it correctly - the "x-httpd-php5s" causes that file to be interpreted as PHP configuration for all the ".php" files in sub-directories.
feklee
If you don't want to modify .htaccess, your problem is unable to be answered.No wonder you have a 25% acceptance rate.
hopeseekr
In what way is the ".htaccess" file bugged? Before modifying anything, I want to replicate the original environment as closely as possible.
feklee
Copy over the apache config exactly and it will work.
hopeseekr