All .php pages returning nothing



Hey folks,
Has anyone seen an instance where all your .php files suddenly return nothing at all? One of my sites just effectively vanished due to this. If I put a .html file up, it works fine, but any of my .php files (which have been fine for years) give me a blank, white page. Sometimes they want to download from the browser as a file instead of a page, in which case I can open them with an editor to find nothing. View source shows nothing. I wrote to support at Dreamhost, but that was several hours ago and nothing back. Is there something dumb I could have done that comes to mind? I haven’t even made any changes recently, so not sure what’s going on.

Thanks very much,


Have you tried different browsers? I’ve heard of similar affecting Firefox users quite often… there’s a few things it could be though.

Can we have a link to try ourselves and see if we get the same problems?


web design, development & seo by DigitalVibe


Thanks for the feedback. I have tried different browsers, but it’s pretty consistent. IE says it just can’t find the server or DNS. Feels like something on the server fell over since I didn’t change anything, but maybe I’m just not thinking of something (hopefully).

A previously working but currently blank file is at:

A working html file is at the root (index.html)


That’s odd, it’s sometimes attributed to slow server response or similar, but that’s pretty immediate.

Has your .htaccess file changed at all? (edit: corrected typo)

Are you running the standard Dreamhost CGI isntallation of PHP, or have you compiled your own?


web design, development & seo by DigitalVibe


Nope, should be standard .php compilation. I think it’s still on 4.whatever, so I could upgrade it to 5.whatever, although not sure how that’d help. I don’t believe I’ve ever messed with .htaccess on this account, and certainly not in the last few months.

This is going to be something dumb, I just have no idea what. Harder since I haven’t done anything in the last few days.


try creating a php file with just this in the page:

If that works, try a little basic test. Another php file containing:

echo "hello world";
Whatever the results of that test are, try switching to PHP 5. See if that makes any difference at all.

And come back with your findings :slight_smile:


web design, development & seo by DigitalVibe


Yeah, tried some simple .php files earlier, and all same results. Same with just phpinfo();…

[a couple of minutes pass as I upgrade to PHP 5]

Well, cool. Now it works. For some reason.

Of course, my main menu script apparently isn’t PHP5 compatible, but that should be easy to fix. Anyone have an idea on what the heck just happened?


Not sure off hand what would have caused the problem…

The menu should work fine, it’s just a warning because the substring the code is looking for does not exist.

Try putting an “@” right before strpos such as:

That should suppress the warning if you’re expecting no substring at times.


web design, development & seo by DigitalVibe


I was trying to parse $PHP_SELF instead of $_SERVER[‘PHP_SELF’] which PHP5 wasn’t pleased with. I wrote all this code some time ago, and if that’s the only thing that goes wrong I’ll consider it A Good Thing.

Thanks very much for your help!



Just a guess, but I’m wondering if one of the recent changes DreamHost made to their PHP4 affected your site’s operation?

While they haven’t given a lot of details on exactly what changes were made, given the timing of your problem, it may not just be coincidence.

Even though that post was 5 days ago, they have been rolling those changes out across the servers in waves, so the changes may have just hit yours.

If your site functions under PHP5, I strongly recommend “tweaking” whatever you need to “upgrade” your code to run under PHP5, as “support” for PHP4 in only going to lessen as time passes. :wink:



That could certainly be the case. I’d be curious what was changed as I couldn’t run anything, but if it’s up now, what the heck. I needed to move it all to PHP5 at some point anyways. :slight_smile:



Unless i’m mistaken, that’d be the register globals thing, which is disabled on PHP5, where as it’s enabled on PHP4.

I always try to be as explicit as possible when i’m coding, which avoids server config issues.

Definately a good thing if that’s the only thing to “break” :slight_smile:


web design, development & seo by DigitalVibe


That same site has a Wordpress back-end in select parts. I wrote a new post earlier this evening (after all of this mess) and it worked. I just tried to write another one and the same issue. post.php tries to download as a blank file.

Excuse me whilst I go bang my head against the wall repeatedly.



That is very annoying indeed…

Last ditch attempt… create a subdomain, do the php test scripts etc. Install wordpress, try it all out.

If it works, then the chances are it’s something you’ve got in your other domain’s config.

If not, poke the Dreamhost staff.


web design, development & seo by DigitalVibe


Also looks like you are on Apache 1.3x, which may mean you need to edit your .htaccess to use the correct Handler (the application/x-httpd-php uses mod_php, which is being phased out)

Try copying /dh/cgi-system/php5.cgi to your /cgi-bin/ and adding the correct handler.

In the future, use a custom php.ini with these error directives and then you can better diagnose what the problem is by viewing the error_log you configure.

error_reporting = E_ALL display_errors = Off display_startup_errors = Off log_errors = On error_log = "/home/username/php_error.log"
[color=#00CC00] _ _| _ _ _ _|_ _ (_|_\|<(_||_)(_|(_| |(/_ | [/color]


Alternatively, wait 24 hours and the problem will magically go away. Meh. I may take a look at the .htaccess file again, though. Thanks for the advice, askapache.