Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP error log shows warnings on line 1768776801

Tags:

php

debugging

I found in my error log this (Note: i didn't removed the filename)

Of course I don't have any script with 1 bn lines.

PHP Version 5.3.3-7
Apache 2

The other weird thing is that I have a

set_error_handler( 'myHandler' );

To write in the error log other inforamtion too, but with this error it seems PHP just ignores my error_handler. I don't have any code that can generate this errore before my call to set_error_handler

Edit

  • Debian at 64Bit
  • I didn't edit, in the error log there aren't any filename, in fact I don't know which script causes this.
  • I have APC installed
like image 619
dynamic Avatar asked Nov 13 '11 09:11

dynamic


People also ask

How do I log errors and warnings into a file in PHP?

If you want to enable PHP error logging in individual files, add this code at the top of the PHP file. ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);

How do I turn off PHP warnings?

The notices can be disabled through settings the php. ini file. In the current file, search for the line of code error_reporting.

How do I log errors and warnings into a file?

Approach 1: The error_log() function can be used to send error messages to a given file. First argument to the function is the error message to be sent. Second argument tells where to send/log the error message. In this case, second argument is set to 3, used to redirect error message to a file.

How do I view PHP error logs?

Look for the entry Configuration File (php. Find the Error handling and logging section of the php. ini file. Make sure that both display_errors = On, display_startup_errors = On and log_errors = On are present and uncommented. Check the value of error_log - this tells you the location of the file errors are logged to.


1 Answers

This is more a comment than an actual answer:

You need to find out which actual code is triggering the error. As long as you don't it's hard to say what specifically is going on.

To start debugging, ensure that you have configured error logging in your php.ini so it's independent to runtime configuration.

Then you can install xdebug and add backtraces to your log. The important part is here, that it is independent to set_error_handler.

This logging information should already give you more insight. If not, start with remote debugging and step through the code until the warning occurs.

Related Question:

  • How can I get PHP to produce a backtrace upon errors?
like image 173
hakre Avatar answered Sep 16 '22 15:09

hakre