Reputation: 2126
I have an app that seems to run fine, but my logs get a few lines like this each day...
ERROR - 2015-07-30 12:19:07 --> Severity: Notice --> Undefined index: HTTP_HOST /application/config/database.php 67
ERROR - 2015-07-30 12:19:07 --> Severity: Notice --> Undefined index: HTTP_HOST /application/config/database.php 68
ERROR - 2015-07-30 12:19:07 --> Severity: Notice --> Undefined index: HTTP_HOST /application/config/database.php 69
ERROR - 2015-07-30 12:19:07 --> Severity: Notice --> Undefined index: HTTP_HOST /application/controllers/Inc.php 15
As I said, the app seems to be running properly but I depend on using $_SERVER['HTTP_HOST'] to ensure proper execution. Is this a known issue with CodeIgniter 3? Especially the database config. I use different databases depending on which instance I am on.
Thanks for any advice.
Upvotes: 1
Views: 146
Reputation: 514
instead of $_SERVER['HTTP_HOST']
you can try using $_SERVER['SERVER_NAME']
The problem is that your server is not sending HTTP_HOST into $_SERVER global variable. This is case many times which varies from server to server
Upvotes: 1