Solved

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

Posted on 2009-05-18
8
3,858 Views
Last Modified: 2013-11-10
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
Comment
Question by:jes12345
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 11

Expert Comment

by:BrianMM
ID: 24410560
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
 

Author Comment

by:jes12345
ID: 24410583
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
 
LVL 11

Accepted Solution

by:
BrianMM earned 500 total points
ID: 24410731
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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

Author Comment

by:jes12345
ID: 24410812
Thanks Brian! I will test this.  (I assume error_reporting(E_ALL ^ E_NOTICE); means report everything except notices ?)

Thanks J
0
 
LVL 11

Expert Comment

by:BrianMM
ID: 24410896
oops... yes indeed sorry!
0
 
LVL 11

Expert Comment

by:BrianMM
ID: 24432476
has this resolved for you?
0
 

Author Comment

by:jes12345
ID: 24433508
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
 

Author Closing Comment

by:jes12345
ID: 31582536
Good answer!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question