How to track PHP errors?

I get the following error:

[23-Feb-2011 19:51:29] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 512 bytes) in /obj/class.db.php on line 60

My problem is that I do not know where this error is. Line 60 of the .db.php class is one of the most used functions in my application (Database Read () function).

How can I track where this error came from?

+3
source share
5 answers

You can try using http://www.xdebug.org/

+5
source

Most likely, exactly where the problem arose - your script absorbs almost all the limitations of 128 megabytes, and then the database class tries to allocate a little more space for reading something from the database, and the script barfs crosses the limit.

What are you doing, why do you need to use 128 megapixel memory?

+1

, , . Database Read() - ?

, , . , , , ini_set('memory_limit', '256M');, 256 , .

:

http://php.net/manual/en/ini.core.php#ini.memory-limit http://php.net/ini_set

Edit

, , Xdebug, , . : http://www.xdebug.org/docs/execution_trace

xdebug.show_mem_delta, , , , - .

+1

php , . php.net. backtrace dump .

php:

set_exception_handler()
set_error_handler()
debug_backtrace();

, , Greetz,

+1

PHP, .

0
source

Source: https://habr.com/ru/post/1794226/


All Articles