Sometimes, after using a third-party extension of PHP, there may be some errors, this time, you may need a more basic way to track the debugger where the error occurred and the reason, familiar with Linux C programming is certainly not unfamiliar gdb
First, use the ULIMIT-C command to see if the system will generate a core file
When the return result is 0 o'clock, the system does not generate a core file, this time using the ULIMIT-C command to change the system's default settings
Shulimit-c unlimited# or ulimit-c n #n大于0的数字
This way, when the program runs incorrectly, it logs the running process to the core file.
In general, the core file is generated under the program run directory, and the file name is similar to core.5740
Here we start using GDB to debug
SH gdb php-c core.5740# after entering a lot of things, and then continue to press the input BT enter, view the execution process # in the GDB runtime environment, using PHP's gdb debug script, where/prefix/php-src-dir PHP is the source directory Source/prefix/php-src-dir/.gdbinit#zbacktrace will be more accurate to PHP error zbacktrace
Detailed use of GDB debugging PHP article, you can refer to Bird's blog
How to debug the core of PHP to get basic information