Solved

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

Posted on 2009-05-18
8
3,760 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Load google maps api into wordpress 5 37
Amazon Redshift 2 26
Access Object's Property 9 22
updating the date data 12 23
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now