Notice: Undefined index: HTTP_CF_CONNECTING_IP in include_once() (line 461 of /home/cooles/public_html/downtown/sites/default/settings.php).

This is the error I get, Drupal install is in a subfolder - code is in settings.php on one line.

Comments

avpaderno’s picture

Use the following code, and you should not get any notice.

if (!empty($_SERVER["HTTP_CF_CONNECTING_IP"])) {
  $_SERVER['REMOTE_ADDR'] =  $_SERVER["HTTP_CF_CONNECTING_IP"];
}
pedrosp’s picture

If this is the right setting , maybe it's time to update the settings on the front of the project page.
Or is there any major difference with the standard setting ?

Thanks for any advice.

patoshi’s picture

getting the same error aswell. that fix only bypasses the notice error, but doesnt actually resolve the issue.

Where is _SERVER["HTTP_CF_CONNECTING_IP"] configured exactly?

Homotechsual’s picture

It's an HTTP header value set by the cloudflare cdn servers afaik.

Brian294’s picture

Category: Bug report » Support request
Issue summary: View changes
Status: Active » Closed (duplicate)

Project page has been updated with new code to use in settings.php. Thank you.