GDB Debugging PHP Extension error

Source: Internet
Author: User
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

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.