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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

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

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

Help - white screen of death


Go to End


7 Posts   2768 Views

Avatar
scoopy

Community Member, 3 Posts

20 July 2011 at 10:29am

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

Community Member, 141 Posts

20 July 2011 at 6:07pm

Hi scoopy.

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

:-)

Cheers

Avatar
scoopy

Community Member, 3 Posts

21 July 2011 at 9:37am

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

Community Member, 141 Posts

21 July 2011 at 9:58am

Edited: 21/07/2011 10:01am

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

Community Member, 3 Posts

21 July 2011 at 10:14am

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

Community Member, 141 Posts

21 July 2011 at 10:31am

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

Forum Moderator, 5523 Posts

21 July 2011 at 4:56pm

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.