Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Help - white screen of death


Reply

7 Posts   1855 Views

Avatar
scoopy

20 July 2011 at 10:29am Community Member, 3 Posts

I've taken on managing this site http://foxtrotters.co.nz/ that has recently thrown up the white screen of death. I've turned on error reporting and these are the errors:

Notice: Use of undefined constant HTTP_HOST - assumed 'HTTP_HOST' in /home/foxtrotter/domains/foxtrotters.co.nz/public_html/foxtrotters/_config.php on line 4

Notice: Use of undefined constant HTTP_HOST - assumed 'HTTP_HOST' in /home/foxtrotter/domains/foxtrotters.co.nz/public_html/foxtrotters/_config.php on line 8

_config file:

<?
error_reporting(E_ALL);

if($_SERVER[HTTP_HOST] == "test") {
   header("Location: http://test.totallydigital.co.nz$_SERVER[REQUEST_URI]");
   die();
}
if($_SERVER[HTTP_HOST] == "dev") {
   header("Location: http://dev.totallydigital.co.nz$_SERVER[REQUEST_URI]");
   die();
}

global $project;
$project = "foxtrotters";

$databaseConfig = array(
   "type" => "MySQLDatabase",
   "server" => "localhost",
   "username" => "xxxxxxx",
   "password" => "xxxxxxx",
   "database" => "xxxxxxx",
);

Director::addRules(100, array(
));

Debug::sendLiveErrorsTo("support@silverstripe.com");

Security::setDefaultAdmin("", "");

?>

Have a look for yourself.

Any ideas?

Avatar
Invader_Zim

20 July 2011 at 6:07pm Community Member, 141 Posts

Hi scoopy.

Check lines 4 and 8 and change $_SERVER[HTTP_HOST] to $_SERVER['HTTP_HOST']

:-)

Cheers

Avatar
scoopy

21 July 2011 at 9:37am Community Member, 3 Posts

Thanks for your help.

Unfortunately it didn't help.

Line 4 is:

header("Location: http://test.totallydigital.co.nz$_SERVER[REQUEST_URI]");

Like I said I took of the management of this site. The site has recently been moved to my server. But it was going for a few months until a few days ago. I have no idea who "http://test.totallydigital.co.nz" is. Do I need to change this?

Thanks

Scoopy

Avatar
Invader_Zim

21 July 2011 at 9:58am (Last edited: 21 July 2011 10:01am), Community Member, 141 Posts

Uhmm, well...

change header("Location: http://test.totallydigital.co.nz$_SERVER[REQUEST_URI]"); to
header("Location: http://test.totallydigital.co.nz$_SERVER['REQUEST_URI']");

Those if-statements send you to the servers test.totallydigital.co.nz, or dev.totallydigital.co.nz if the value of $_SERVER['HTTP_HOST'] is 'test' or 'dev'.

BUT if you don't have a clue who or what totallydigital.co.nz is, I would advise to delete these two if statements
and have a nice long talk to the guy from whom you've taken the site.

Cheers

Avatar
scoopy

21 July 2011 at 10:14am Community Member, 3 Posts

I've deleted the if statements but still getting the error. Now reads:

<?

global $project;
$project = "foxtrotters";

$databaseConfig = array(
   "type" => "xxxxx",
   "server" => "xxxxx",
   "username" => "xxxxxx",
   "password" => "xxxxxx",
   "database" => "xxxxx",
);

Director::addRules(100, array(
));

Debug::sendLiveErrorsTo("support@silverstripe.com");

Security::setDefaultAdmin("", "");

?>

Thanks again for your help

Scoopy

Avatar
Invader_Zim

21 July 2011 at 10:31am Community Member, 141 Posts

Yeah, I can see the same error as well... strange... now I'm stuck...

Might be a really dumb question, but you have uploaded the new, edited _config.php to your server, right?

Or what happens if you add the line
echo 'my _config works!';
before the line with global $project;?

Cheers

Avatar
Willr

21 July 2011 at 4:56pm Forum Moderator, 5511 Posts

FYI totallydigital used to be what SilverStripe Limited used to be called. We morphed into SilverStripe from totallyd around 2006.

You can remove that header line completely - if you wanted to know why we had that it's because we normally use local references on our internal network (i.e test/site rather than test.silverstripe.com/site) that line redirected test/site to the full version.

Debug::sendLiveErrorsTo("support@silverstripe.com");

You may also want to remove that line, our support admins will probably not want to know your passwords.