Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4083
  • Last Modified:

PHP Notice:Undefined index: REMOTE_ADDR - email from DRUPAL cron job

We have a drupal installation and we get recurring emails from cron saying the following:

PHP Notice: Undefined index: REMOTE_ADDR in /var/www/vhosts/eideforum.no/httpdocs/includes/bootstrap.inc on line 1175
PHP Notice: Undefined index: REMOTE_ADDR in /var/www/vhosts/eideforum.no/httpdocs/includes/bootstrap.inc on line 1175
PHP Notice: Undefined index: REQUEST_METHOD in /var/www/vhosts/eideforum.no/httpdocs/includes/bootstrap.inc on line 554

What exactly is this undefined index notice and how can we avoid it? I assume this is only a warning type message and can be ignored?
0
jes12345
Asked:
jes12345
  • 4
  • 4
1 Solution
 
BrianMMCommented:
It means these items are not in the Array, if you want to eliminate fully... search the code for the references and if you are happy they are not needed you could comment them out.

But they are Notices and unless the code is using them later on can be ignored.
0
 
jes12345Author Commented:
Hi thanks for the reply. Theses messages comes from the drupal core so I do not really want to change the code. Is there a way I can supress the messages by setting some value in php.ini or similar?
Thanks J
0
 
BrianMMCommented:
yes...

but will still need slight modifying...

error_reporting(E_ALL ^ E_NOTICE);

or

error_reporting(0);

to turn it off.

Add to the top of bootstrap.inc...

I am not overly familiar with Durpal, but it may have some configuration for this too... but adding above to that file will suppress it for that file... you may not want to supporess everything...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
jes12345Author Commented:
Thanks Brian! I will test this.  (I assume error_reporting(E_ALL ^ E_NOTICE); means report everything except notices ?)

Thanks J
0
 
BrianMMCommented:
oops... yes indeed sorry!
0
 
BrianMMCommented:
has this resolved for you?
0
 
jes12345Author Commented:
Hi - sorry for the delay. We just tested this afternoon and it worked like a charm - points are on the way:) Many thanks for the help and advise. J
0
 
jes12345Author Commented:
Good answer!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now