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

Nginx Lot of 502 errors after upgrading to PHP 5.6.4

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Andy, Dec 20, 2014.

  1. eva2000

    eva2000 Administrator Staff Member

    52,767
    12,078
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,605
    Local Time:
    8:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    with PHP 5.6.4 try recompiling some of the custom PHP extensions so run centmin.sh menu options 10 and 15 for memcached/memcache and imagemagick recompile and menu option 7 only if you're using APC Cache and menu option 12 if you're using Zend OpCache.

    Code:
    --------------------------------------------------------
    Centmin Mod 1.2.3-eva2000.08 - http://centminmod.com
    --------------------------------------------------------
                       Centmin Mod Menu               
    --------------------------------------------------------
    1).  Centmin Install
    2).  Add Nginx vhost domain
    3).  NSD setup domain name DNS
    4).  Nginx Upgrade / Downgrade
    5).  PHP Upgrade / Downgrade
    6).  XCache Re-install
    7).  APC Cache Re-install
    8).  XCache Install
    9).  APC Cache Install
    10). Memcached Server Re-install
    11). MariaDB 5.2, 5.5, 10 Upgrade Sub-Menu
    12). Zend OpCache Install/Re-install
    13). Install ioping.sh vbtechsupport.com/1239/
    14). SELinux disable
    15). Install/Re-install ImageMagick PHP Extension
    16). Change SSHD Port Number
    17). Multi-thread compression: pigz,pbzip2,lbzip2,p7zip etc
    18). Suhosin PHP Extension install
    19). Install FFMPEG and FFMPEG PHP Extension
    20). NSD Re-install
    21). Update - Nginx + PHP-FPM + Siege
    22). Exit
    --------------------------------------------------------
    Enter option [ 1 - 22 ]
    --------------------------------------------------------


     
  2. rdan

    rdan Well-Known Member

    5,438
    1,396
    113
    May 25, 2014
    Ratings:
    +2,184
    Local Time:
    6:09 PM
    Mainline
    10.2
    I thought it was auto during php upgrade?
     
  3. rdan

    rdan Well-Known Member

    5,438
    1,396
    113
    May 25, 2014
    Ratings:
    +2,184
    Local Time:
    6:09 PM
    Mainline
    10.2
    What should be the correct value here? :)
     
  4. Andy

    Andy Active Member

    535
    88
    28
    Aug 6, 2014
    Ratings:
    +129
    Local Time:
    5:09 AM
    Code:
    ; Log level
    ; Possible Values: alert, error, warning, notice, debug
    ; Default Value: notice
    log_level = warning
    pid = /var/run/php-fpm/php-fpm.pid
    error_log = /var/log/php-fpm/www-error.log
    emergency_restart_threshold = 10
    emergency_restart_interval = 1m
    process_control_timeout = 10s
    ;include=/usr/local/nginx/conf/phpfpmd/*.conf
    
    [www]
    user = nginx
    group = nginx
    
    listen = 127.0.0.1:9000
    listen.allowed_clients = 127.0.0.1
    ;listen.backlog = -1
    
    ;listen = /tmp/php5-fpm.sock
    ;listen.owner = nginx
    ;listen.group = nginx
    ;listen.mode = 0666
    
    pm = static
    pm.max_children = 16
    ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
    pm.start_servers = 8
    pm.min_spare_servers = 4
    pm.max_spare_servers = 12
    pm.max_requests = 1000
    
    ; PHP 5.3.9 setting
    ; The number of seconds after which an idle process will be killed.
    ; Note: Used only when pm is set to 'ondemand'
    ; Default Value: 10s
    pm.process_idle_timeout = 10s;
    
    rlimit_files = 65536
    rlimit_core = 0
    
    ; The timeout for serving a single request after which the worker process will
    ; be killed. This option should be used when the 'max_execution_time' ini option
    ; does not stop script execution for some reason. A value of '0' means 'off'.
    ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
    ; Default Value: 0
    ;request_terminate_timeout = 0
    ; Default Value: 0
    ;request_slowlog_timeout = 0
    slowlog = /var/log/php-fpm/www-slow.log
    
    pm.status_path = /phpstatus
    ping.path = /phpping
    ping.response = pong
    
    ; Limits the extensions of the main script FPM will allow to parse. This can
    ; prevent configuration mistakes on the web server side. You should only limit
    ; FPM to .php extensions to prevent malicious users to use other extensions to
    ; exectute php code.
    ; Note: set an empty value to allow all extensions.
    ; Default Value: .php
    security.limit_extensions = .php .php3 .php4 .php5
    
    ; catch_workers_output = yes
    php_admin_value[error_log] = /var/log/php-fpm/www-php.error.log
     
  5. eva2000

    eva2000 Administrator Staff Member

    52,767
    12,078
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,605
    Local Time:
    8:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    that's a cosmetic bug corrected in latest Centmin Mod .08 betas, just enter 7.0.3 it's ignored if you're using PHP 5.5 or 5.6 for final version anyway as those use 7.0.4-dev

    yeah should be auto recompiled but only for major PHP upgrades not minor
     
    Last edited: Dec 22, 2014
  6. rdan

    rdan Well-Known Member

    5,438
    1,396
    113
    May 25, 2014
    Ratings:
    +2,184
    Local Time:
    6:09 PM
    Mainline
    10.2
    After doing it I can't open my opcache.php anymore :(
    Only blank page.
     
  7. eva2000

    eva2000 Administrator Staff Member

    52,767
    12,078
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,605
    Local Time:
    8:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    what happens when you restart PHP-FPM service ?
     
  8. rdan

    rdan Well-Known Member

    5,438
    1,396
    113
    May 25, 2014
    Ratings:
    +2,184
    Local Time:
    6:09 PM
    Mainline
    10.2
    And now I have 20mb+ size of the php-fpm error log :(
    I have to grab that .08 beta branch now.
    Then I will re-upgrade PHP.
     
  9. Andy

    Andy Active Member

    535
    88
    28
    Aug 6, 2014
    Ratings:
    +129
    Local Time:
    5:09 AM
    check your server load as well by doing uptime
     
  10. rdan

    rdan Well-Known Member

    5,438
    1,396
    113
    May 25, 2014
    Ratings:
    +2,184
    Local Time:
    6:09 PM
    Mainline
    10.2
    Just normal.
    But I can't open the error log as it's increasing file size :(
     
  11. eva2000

    eva2000 Administrator Staff Member

    52,767
    12,078
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,605
    Local Time:
    8:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    For now only thing to do is downgrade to 5.6.3 first as unfortunately I don't have that much free time to diagnose 5.6.4 issues :(
     
  12. rdan

    rdan Well-Known Member

    5,438
    1,396
    113
    May 25, 2014
    Ratings:
    +2,184
    Local Time:
    6:09 PM
    Mainline
    10.2
    This is the updated branch right? "123.08centos7beta01" ?
     
  13. eva2000

    eva2000 Administrator Staff Member

    52,767
    12,078
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,605
    Local Time:
    8:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  14. rdan

    rdan Well-Known Member

    5,438
    1,396
    113
    May 25, 2014
    Ratings:
    +2,184
    Local Time:
    6:09 PM
    Mainline
    10.2
    Server loads seems normal using PHP 5.6.4.
     
  15. rdan

    rdan Well-Known Member

    5,438
    1,396
    113
    May 25, 2014
    Ratings:
    +2,184
    Local Time:
    6:09 PM
    Mainline
    10.2
    Updating/re-installing PHP using the .08 beta branch revert my customization's on the .ini files on /etc/centminmod/php.d.
    Why?
     
  16. eva2000

    eva2000 Administrator Staff Member

    52,767
    12,078
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,605
    Local Time:
    8:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    in which files specifically ?
     
  17. rdan

    rdan Well-Known Member

    5,438
    1,396
    113
    May 25, 2014
    Ratings:
    +2,184
    Local Time:
    6:09 PM
    Mainline
    10.2
    custom_php.ini, curlcainfo.ini, zendopcache.ini.
     
  18. eva2000

    eva2000 Administrator Staff Member

    52,767
    12,078
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,605
    Local Time:
    8:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    zendopcache.ini changed probably with your custom recompile of zend opcache via menu option 12, but the first 2 shouldn't of changed..

    what changed in custom_php.ini ?

    PHP 5.6.4 seems to have a bug for me in that custom.ini set PHP settings from some files in /etc/centminmod/php.d aren't recognised by PHP 5.6.4 and doesn't show in PHP INFO page
     
  19. rdan

    rdan Well-Known Member

    5,438
    1,396
    113
    May 25, 2014
    Ratings:
    +2,184
    Local Time:
    6:09 PM
    Mainline
    10.2
    Maybe you're correct.

    Always revert to whats default on centminmod install.
    It show's for me, like date timezone.
     
  20. eva2000

    eva2000 Administrator Staff Member

    52,767
    12,078
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,605
    Local Time:
    8:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    that's problem i have with PHP 5.6.4 what is set in your own custom_php.ini or my custom.ini at /etc/centminmod/php.d isn't shown in php info page. Is date and timezone set in custom_php.ini or in /usr/local/lib/php.ini ?