LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-18-2008, 05:23 AM   #1
Braynid
Member
 
Registered: May 2006
Location: Romania
Distribution: CentOS
Posts: 140

Rep: Reputation: 15
Question Huge amount of "PHP Notice:" -> huge logs


Hey,

For some while now I've been having this problem with a site we host. In the 'error_log' for the site I've fount MANY (as in several GB logs) PHP notices that look something like:

Code:
[Tue Mar 18 11:58:25 2008] [error] [client some.ip.here] PHP Notice:  Undefined index:  check_3 in /var/www/vhosts/mydomain/httpdocs/somefile.php on line 150, referer: http://referer/url
there are also other notices, like:

Code:
PHP Notice:  Undefined variable:
PHP Notice:  Use of undefined constant REQUEST_URI - assumed 'REQUEST_URI' in
PHP Notice:  Use of undefined constant ppp - assumed 'ppp' in
The code works fine and I don't understand why it gives this notices. Is there any way to silence PHP and don't show this errors? The problem is that they created around 8GB of logs in just a week.

Thanks.
 
Old 03-18-2008, 05:51 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
change the error_reporting option in your php.ini file to not invlude E_NOTICE
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; error_reporting is a bit-field.  Or each number up to get desired error
; reporting level
; E_ALL             - All errors and warnings (doesn't include E_STRICT)
; E_ERROR           - fatal run-time errors
; E_WARNING         - run-time warnings (non-fatal errors)
; E_PARSE           - compile-time parse errors
; E_NOTICE          - run-time notices (these are warnings which often result
;                     from a bug in your code, but it's possible that it was
;                     intentional (e.g., using an uninitialized variable and
;                     relying on the fact it's automatically initialized to an
;                     empty string)
; E_STRICT          - run-time notices, enable to have PHP suggest changes
;                     to your code which will ensure the best interoperability
;                     and forward compatibility of your code
; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
;                     initial startup
; E_COMPILE_ERROR   - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR      - user-generated error message
; E_USER_WARNING    - user-generated warning message
; E_USER_NOTICE     - user-generated notice message
;
; Examples:
;
;   - Show all errors, except for notices and coding standards warnings
;
;error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
;
;   - Show all errors, except for notices
;
;error_reporting = E_ALL & ~E_NOTICE
;
;   - Show only errors
;
;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
;
;   - Show all errors
;
error_reporting  =  E_ALL
 
Old 03-18-2008, 06:30 AM   #3
Braynid
Member
 
Registered: May 2006
Location: Romania
Distribution: CentOS
Posts: 140

Original Poster
Rep: Reputation: 15
Thanks, that stopped the logs from getting bigger. But can you please tell me what was generating them, so I know what to look for?!

Thanks.
 
Old 03-18-2008, 06:32 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
looking at the examples, bad coding. ;-)
 
Old 03-18-2008, 06:35 AM   #5
Braynid
Member
 
Registered: May 2006
Location: Romania
Distribution: CentOS
Posts: 140

Original Poster
Rep: Reputation: 15
Is there a possibility that such notices are generated when PHP is looking in GET for elements that aren't there?

Anyway the log problem is solved, thanks acid_kewpie!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Utterly Improbably Huge "Which Distro" SuperMegaThread Garsutra Linux - Distributions 233 02-16-2008 10:50 AM
Removing "#" character in a huge txt file tmaxx Linux - General 3 10-24-2006 03:04 AM
Huge log file grow since "yum update" on 29 April cubensys Fedora 1 05-21-2006 06:34 AM
Huge amount of stuff needs to be listed but how? Totoro Linux - Newbie 2 03-20-2004 02:10 AM
Screen "scrolls" ... desktop huge! Ben Sytko Slackware 2 03-12-2004 06:44 PM


All times are GMT -5. The time now is 11:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration