Get the most out of your Centmin Mod LEMP stack
Become a Member

Stable Branch improve PHPDEBUGMODE='y' mode in 132.00stable

Discussion in 'Centmin Mod Github Commits' started by eva2000, May 6, 2025.

  1. eva2000

    eva2000 Administrator Staff Member

    58,916
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    7:16 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    improve PHPDEBUGMODE='y' mode in 132.00stable

    - improve PHPDEBUGMODE='y' mode outlined in https://community.centminmod.com/threads/how-to-guide-for-nginx-php-fpm-debugging.17508/


    When persistent config file temporarily enables PHP debug mode for gdb backtracing troubleshooting PHP :: Generating a gdb backtrace via persistent config file variables set in /etc/centminmod/custom_config.inc

    Code (Text):
    PHPDEBUGMODE='y'
    AUTODETECPHP_OVERRIDE='y' # ensure all PHP extensions are recompiled


    Then you re‑compile PHP via centmin.sh menu option 5

    Which will do the following:

    1. adds ‑g3 ‑O0 ‑fno‑omit‑frame‑pointer to **CFLAGS/CXXFLAGS**
    2. installs a systemd drop‑in file /etc/systemd/system/php-fpm.service.d/10-coredump.conf to setup LimitCORE=infinity
    3. points kernel.core_pattern to /tmp/core-%e-%p-%t
    4. sets fs.suid_dumpable = 1

    Then to disable PHP debug mode, set persistent config file variables in /etc/centminmod/custom_config.inc:

    Code (Text):
    PHPDEBUGMODE=n
    AUTODETECPHP_OVERRIDE='y' # ensure all PHP extensions are recompiled


    Then you re‑compile PHP via centmin.sh menu option 5

    This will do the following:

    1. remove the systemd drop‑in /etc/systemd/system/php-fpm.service.d/10-coredump.conf
    2. restore the original kernel.core_pattern & fs.suid_dumpable settings
    3. re‑compile PHP without heavy debug flags
    4. if PHP_CLEAN_COREDUMPS=y (the default) delete stale core files in /tmp

    Continue reading...

    132.00stable branch