apache error log fills up with php notice:

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • siliconmike

    apache error log fills up with php notice:

    apache error log:

    /var/log/httpd-error.log

    gets filled up with various notices such as:

    php notice: Use of undefined constant name - assumed 'name' in xxxxx on
    line 1, referer: yyyy

    the size of the file is 200 mb now..

    how do I suppress these notices without touching my php source code ?

    Mike

  • Mike Willbanks

    #2
    Re: apache error log fills up with php notice:

    Mike,[color=blue]
    > apache error log:
    >
    > /var/log/httpd-error.log
    >
    > gets filled up with various notices such as:
    >
    > php notice: Use of undefined constant name - assumed 'name' in xxxxx on
    > line 1, referer: yyyy
    >
    > the size of the file is 200 mb now..
    >
    > how do I suppress these notices without touching my php source code ?[/color]

    What you could simply do is create a .htaccess environmental variable
    with php_flag error_reporting E_ALL & ~E_NOTICE

    In your php configuration you could set error_reporting to that value as
    well.

    I would also suggest that you fix the code that is giving the E_NOTICE
    problems. Your problem with the use of an undefined constant is most
    likely because you are using an array and not puting in the '.

    For example you are doing: $array[index]
    The correct way is: $array['index']

    If you are inside of a string with "" use: {$array['index']}


    --
    Mike Willbanks
    Zend Certified Engineer

    Comment

    • siliconmike

      #3
      Re: apache error log fills up with php notice:

      Worked well. Thanks.
      Mike

      Mike Willbanks wrote:[color=blue]
      > Mike,[color=green]
      > > apache error log:
      > >
      > > /var/log/httpd-error.log
      > >
      > > gets filled up with various notices such as:
      > >
      > > php notice: Use of undefined constant name - assumed 'name' in xxxxx on
      > > line 1, referer: yyyy
      > >
      > > the size of the file is 200 mb now..
      > >
      > > how do I suppress these notices without touching my php source code ?[/color]
      >
      > What you could simply do is create a .htaccess environmental variable
      > with php_flag error_reporting E_ALL & ~E_NOTICE
      >
      > In your php configuration you could set error_reporting to that value as
      > well.
      >
      > I would also suggest that you fix the code that is giving the E_NOTICE
      > problems. Your problem with the use of an undefined constant is most
      > likely because you are using an array and not puting in the '.
      >
      > For example you are doing: $array[index]
      > The correct way is: $array['index']
      >
      > If you are inside of a string with "" use: {$array['index']}
      >
      >
      > --
      > Mike Willbanks
      > Zend Certified Engineer
      > http://www.digitalstruct.com[/color]

      Comment

      Working...