Page 1 of 1

application/x-httpd-php5s .php - problem

PostPosted: 20. October 2010 23:39
by almalino
Hello All !
I have a Drupal 6 site running on Bluehost. I've been developing it using LAMP 1.7.1 on Windows. Everything worked fine on windows and on Bluehost.
Now I moved to Kubuntu 10.10 and I'm having a problem with .htaccess file generated by Bluehost.

Here what I have done on Kubuntu:
1. Installed XAMP 1.7.1
2. Started all services and checked that XAMP status is green.
3. Copied my site from Bluehost public_html/ to XAMP htdocs/ directory (this worked like a charm on Windows with LAMP)
4. tried to access site with

Problem: index.php is not executed. Instead, web browser offer to download the file.

After some digging into the problem I found out it is .htaccess file generated by Bluehost is guilty. If I comment out following line in it:

# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php

it start working fine and index.php file start executing.

Everything worked fine in LAMP 1.7.1. It broke in XAMP 1.7.1. Any ideas how to fix that? One thing I do not want to change is .htaccess file since it is generated by Bluehost.

Any help will be appreciated!

Re: application/x-httpd-php5s .php - problem

PostPosted: 20. October 2010 23:59
by almalino

Re: application/x-httpd-php5s .php - problem

PostPosted: 21. October 2010 00:35
by almalino ... #post85591
I got uanswer that is in line with answer here: ... pd-php5s-s

Basically it is a Bluehost feature to support several PHP versions. To fix it locally we should add to apache:

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

Now , the question is where is PHP executable in XAMP? I canot find it. Any ideas?

Re: application/x-httpd-php5s .php - problem

PostPosted: 21. October 2010 19:20
by JonB
OK -

1st - you can't just adopt pieces of PHP (I'm speaking of executables) from one install (server and OS) to another - long story - no time to tell you details, you may presume I am right if you choose to.

here is YOUR answer - and it has nothing to do with the PHP executable.

For youe local installation - provided you local Joomla install will work on YOUR machine without the Bluehost mucky-muck .htaccess file - (you could test by just removing the parts giving trouble) -

You simply have to change the naming convention for AccessFileName on your local machine. Apache doesn't REALLY care what the .htaccess file is called - you could call it .htaccesslocal if you wanted.

SO - you change the name of the file that Apache will look for Directives in, leave the Bluehost .htacess file as it is. (you aren't gpoing to be loading multiple versions of PHP), What ever else is in the .htaccess file - you put in your Access file (which could be .htaccesslocal) If you have things like mod_rewrite directives they may be preserved in the access file for your local server. Your XAMPP server will now IGNORE the BlueHost thingy - so no problems there - and obey teh directives in the local version of an Access file. ... ssfilename

AFAIK - XAMPP uses the Apache default -- .htaccess, so you probably won't find an AccessFileName directive in the /xampp/apache/httpd.conf. Its Context is Server or Vhost - so it could be placed in in the httpd.conf file. I don't think it matters the location, but I would place it after the declaration of the DocumentRoot

To make the access file name .htaccesslcoal:
Code: Select all
AccessFileName .htaccesslocal

I recoomend you use something that begins with .ht due tio this FilesMatch - that keeps folks from DL'ing or reading your .htaaccess or .htpasswd files:
Code: Select all
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All

BTW the BlueHost server will ignore your file (as it doesn't care about .htaccesslocal) so you can completely sync the folders.

Re: application/x-httpd-php5s .php - problem

PostPosted: 22. October 2010 00:05
by almalino
JonB, thank you for your detailed answer! I appreciate that!

Unfortunately, I cannot make XAMPP to pick up new .htaccesslocal file. I tried to follow your istructions. But XAMPP still picks up .htaccess file always.
I tried starting/stopping servers etc. No go. Any ideas why?

Re: application/x-httpd-php5s .php - problem

PostPosted: 22. October 2010 02:28
by JonB
I relied in your later hread - I missed an occurence of teh AccessFileName directive.