PHP not working on subdomain


#1

I’m brand new to Dreamhost, but not to web development/hosting. I’ve just started the process of moving some sites over and I seem to be having an odd problem in a subdomain:

When I try to request a PHP script via a browser, I am prompted to download it instead of it being processed by the server. However, PHP seems to be executed just fine in the primary domain.

http://media.flyingpylon.com/phpinfo.php

Anyone have any ideas? Is there a switch I’m supposed to flip to get PHP on a subdomain?

Thanks.


#2

Welcome to DreamHost :wink:

Try going into [color=#00CC00]Panel > Domains > Manage Domains[/color] and hit the [color=#0000CC]Fully Host[/color] button again.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#3

Thanks for the suggestion, but it doesn’t seem to have made a difference.

I just set up a new test subdomain and it worked immediately, so I think I’m just going to remove the non-working one and then recreate it.


#4

I’ve heard of this before, but can’t remember exactly the fix. It was either something Support tracked down, or it was in .htaccess.

-Scott


#5

.htaccess can certainly make it happen (although it’s usually on purpose!).

Hitting Fully Host again often kicks the server’s tyre and gets things in order. Perhaps something didn’t quite “take” on the backend on the first attempt at adding the subbie. Thankfully, removing and readding domains is a painless process via the Panel :slight_smile:

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#6

I found the solution to this and just wanted to report back. Turns out that it was the .htaccess file.

At my old host, I needed “AddHandler php5-script .php” in .htaccess to enable PHP5, but at Dreamhost that line causes problems, apparently. Simply removing it did the trick.

Creating a new test subdomain worked because I only uploaded a phpinfo.php file to test it, but the bad .htaccess file was included when I uploaded all of my site’s files.


#7

Ahh good stuff. We’ve all been floored by a rogue .htaccess at some stage I’m sure.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost