By big_smile on
When building a Drupal site, I like to download it and run it under MAMP so I can tryout modules without breaking the live site.
I have done this for many sites and it works really well.
However, for my latest site, when clicking on the root directory of the site, the browser does not go to the front page. Instead, the "save download" dialogue appears. In Firefox it states that I am trying to download a "application/x-httpd-php" file.
Does anyone know the solution to this? It has not happened to me before.
A Google search reveals that it has happened to another user but there does not seem to be a solution.
Comments
Note: it applies to Druapl
Note: it applies to Druapl 5.11
Do you have other sites
Do you have other sites which work correctly on the same MAMP installation at same time that this happens?
First thing, clear your browser's cache and restart the browser.
Are you using port 8888 like that guy? If so, are you entering that in the URL when browsing? Is it part of a multisite with its own sites/site-name/settings.php? If so, does the name include a port number?
Also check if you have any AddHandler or SetHandler lines in Drupal's main .htaccess file or in any other .htaccess files in parent directories.
Do you have other sites
Do you have other sites which work correctly on the same MAMP installation at same time that this happens?
Yes. All the other sites work fine. It's just this one!
First thing, clear your browser's cache and restart the browser.
No luck. I have also tried it on two seperate Macs (one running tiger on Power PC and the other running Leopard on Intel Mac). Same problem.
Are you using port 8888 like that guy?
Yes
If so, are you entering that in the URL when browsing?
Yes. The url is http://localhost:8888/druaplsite.
When I enter the url for the other sites on the same MAMP installation (e.g. http://localhost:8888/clothessite) they work fine.
Also check if you have any AddHandler or SetHandler lines in Drupal's main .htaccess file or in any other .htaccess files in parent directories.
In the drupal .htaccess file I have "AddHandler application/x-httpd-php .php .html .htm".
I added this to make the site run PHP5.
However, even if I remove this line, the problem remains.
In this thread it says modifying httpd.conf to include "AllowOverride None" should fix the problem. I tried this and the problem remains.
However, if I try to access a specific page on the site (e.g. http://localhost:8888/druaplsite/index.php) I can view the page and the use the site as normal. (Before making the "AllowOverride None" modification, accessing a spescific page would produce a blank white page.)
Whilst this is an improvement, I would like to be able to access the site by just clicking on the root directory (like I can for my other sites) without getting the "download a application/x-httpd-php file message.
Do the other sites have the
Do the other sites have the same exact AddHandler line in their .htaccess? Any other differences?
Pick one of the working sites and search httpd.conf for anything specific about its directory or its domain. Do the same for the broken site and compare.
It's very strange, but the
It's very strange, but the problem seems to have fixed itself.
I'm not sure why, as I haven't changed anything.
Ditto!
I hope the same happens to me as I have exactly the same problem.
I had previously add a line to .htaccess to allow PHP 5 to work.
Exactly same problems. Would be interested to know what has caused it.
problem with firefox downloading rather than rendering php
I was also having this problem with firefox downloading rather than rendering php and clearing the firefox cache worked for me.
This was only happening on http://mysite/ and not on http://mysite/user for example.
This was happening on all my sites (but I was switching between them using MAMP preferences so they looked the same to firefox)
I was using port 80, Drupal 6 and php 5.2
My AddHandler lines were OK.
Help with WAMP
HELLO,
I have recently decided to start configuring my drupal 7 sites via WAMP. When I start with a fresh install of drupal 7, there is not any problems. However, when I bring my already active drupal 7 sites to WAMP, and transfer all the SQL databases over, I try to view it with my web-browser. Instead of displaying the website, it starts downloading the file.
What is the problem? Does anyone know what I can do to fix this?
Thank you.
I was getting this prompt to
I was getting this prompt to download 'application/x-httpd-php' after copying a site from my web server and setting it up locally.
After searching around I came across the following line at the top of my .htaccess file
AddHandler php5_2-wrap .php
No idea how it got there, but after removing it, everything is working ok. Very weird.