Welcome to Centmin Mod Community
Become a Member

Wordpress wp_updater_domain.com.sh restarting nginx instead of php-fpm

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by iaTa, Mar 8, 2026.

  1. iaTa

    iaTa Member

    94
    18
    8
    Mar 26, 2018
    Ratings:
    +36
    Local Time:
    6:07 AM
    Nginx 1.31.x
    MariaDB 10.11.x
    • CentOS Version: AlmaLinux 9.7
    • Centmin Mod Version Installed: 140.00beta01.b288
    • Nginx Version Installed: 1.29.5
    • PHP Version Installed: 8.3.30
    • MariaDB MySQL Version Installed: 10.11.16
    • Updated Centmin Mod code base: Today
    I was reviewing the logic in the auto WP updater script (wp_updater_domain.com.sh) and noticed that when plugin updates occur and OPcache is enabled with a revalidation frequency > 10, the script reloads nginx rather than php-fpm.

    Relevant section:
    Code (Text):
    if [[ -f .wpcli-status && ! "$(grep -w 'Plugin already updated' .wpcli-status)" ]]; then
    exec 99>/tmp/wp_updater_phpfpm.lock
    if flock -n -x 99; then
    # only do nginx + php-fpm restarts when zend opcache caching is enabled and revalidation
    # frequency is greater than 10 seconds set by opcache.revalidate_freq php setting
    if [[ "$(php --ri "Zend Opcache" >/dev/null 2>&1; echo $?)" -eq '0' && "$(php --ri "Zend Opcache" | awk '/opcache.revalidate_freq/ {print $3}')" -gt '10' ]]; then
    service nginx reload
    fi
    rm -rf /tmp/wp_updater_phpfpm.lock
    else
    echo "already detected running process"
    echo "skipping nginx reload"
    fi
    fi
    

    From what I understand, reloading nginx does not clear OPcache because the PHP bytecode cache lives in the php-fpm workers, not nginx.

    So if the goal is to ensure updated plugin PHP files are picked up immediately when opcache.revalidate_freq is > 10, wouldn't it make more sense to reload php-fpm instead?


    For example:
    Code (Text):
    service php-fpm reload
    

    Just wanted to check whether the nginx reload here is intentional for some other reason, or if this should actually be a php-fpm reload.

    Thanks.
     
  2. eva2000

    eva2000 Administrator Staff Member

    59,120
    12,506
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,138
    Local Time:
    3:07 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Thanks for bug report. I've fixed this in 132.00stable, 140.00beta01 and 141.00beta01. You can run cmupdate to pull down latest fixes for future centmin.sh menu option 22 installs. For existing installed Wordpress instances, after cmupdate, run and exit centmin.sh once to fix those wp_updater_domain.com.sh instances :)
     
  3. iaTa

    iaTa Member

    94
    18
    8
    Mar 26, 2018
    Ratings:
    +36
    Local Time:
    6:07 AM
    Nginx 1.31.x
    MariaDB 10.11.x
    Existing scripts updated to reload php-fpm rather than nginx, thank you!
     
  4. eva2000

    eva2000 Administrator Staff Member

    59,120
    12,506
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,138
    Local Time:
    3:07 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Thanks for the confirmation for bug fix :)