application/x-httpd-php5s .php - problem

Problems with the Linux version of XAMPP, questions, comments, and anything related.

application/x-httpd-php5s .php - problem

Postby almalino » 20. October 2010 23:39

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 127.0.0.1

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.

Question:
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!
Alexei
almalino
 
Posts: 8
Joined: 20. October 2010 23:27

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

Postby almalino » 20. October 2010 23:59

almalino
 
Posts: 8
Joined: 20. October 2010 23:27

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

Postby almalino » 21. October 2010 00:35

http://www.bluehostforum.com/showthread ... #post85591
I got uanswer that is in line with answer here:
http://stackoverflow.com/questions/3637 ... 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?
almalino
 
Posts: 8
Joined: 20. October 2010 23:27

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

Postby JonB » 21. October 2010 19:20

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.

http://httpd.apache.org/docs/2.0/mod/co ... 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
</FilesMatch>

BTW the BlueHost server will ignore your file (as it doesn't care about .htaccesslocal) so you can completely sync the folders.
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

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

Postby almalino » 22. October 2010 00:05

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?
almalino
 
Posts: 8
Joined: 20. October 2010 23:27

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

Postby JonB » 22. October 2010 02:28

I relied in your later hread - I missed an occurence of teh AccessFileName directive.

:D
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 12 guests