?
Solved

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

Posted on 2009-05-18
8
Medium Priority
?
3,997 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 2000 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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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 …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
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…
Suggested Courses

719 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