Solved

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

Posted on 2009-05-18
8
3,790 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
  • 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Checking CSRF token within a function 36 74
mysql between clause 2 22
Be edit-table when I click the edit button (turn into inputs boxes) 7 28
php checkbox validation 5 27
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

776 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