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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

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

Advice on the best _config.php setup?


Go to End


2042 Views

Avatar
3dkiwi

Community Member, 18 Posts

10 April 2008 at 11:41am


Guys

Hopefully not a too difficult one for a stunning autumn Thursday...

I have read and reread the devmode, debug and other pages on the wiki and am not totally sure of the correct/best setup of the _config.php file for a live site.

My main issue is that if I remove the Director::set_dev_servers directive as suggested in the devmode page
ie as below:

xxx
// Sites running on the following servers will be
// run in development mode. See
// http://doc.silverstripe.com/doku.php?id=devmode
// for a description of what dev mode does.
//Director::set_dev_servers(array(
// '127.0.01',
// 'localhost'
//));

Director::set_environment_type("live");
xxx

I get the following error repeated multiple times in the Apache logfile:

PHP Notice: Undefined index: HTTP_HOST in .../sapphire/core/control/Director.php on line 482

This message also is reported on lines 487, 224 of the Director.php and on line line 29 of .../sapphire/core/control/RootURL/Controller.php

I thought setting the Director::set_evironment_type() to live might override the use of the set_dev_servers() but it does not seem to.

Any thoughts on what a secure, working _config.php should look like for a live (internet facing) site that does not fill the apache logfiles with PHP errors?

Cheers
Jim