Want to subscribe to topics you're interested in?
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. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    10:07 PM
    Mainline
    10.2
    date and timezone set in custom_php.ini, and it works based on /admin.php?tools/phpinfo

     
  2. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    then i am experiencing a different bug in PHP 5.6.4 heh
     
  3. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    10:07 PM
    Mainline
    10.2
    That's not a bug, but maybe you missed some other things :)
     
  4. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    ah i see what my problem is.. using Centmin Mod .08 beta it creates it's own custom_php.ini file while I had my customisations in my own custom.ini so you end up with 2 files custom.ini and custom_php.ini where custom_php.ini took priority it seems LOL

    Code:
    [root@ln01 logs]# php --ini
    Configuration File (php.ini) Path: /usr/local/lib
    Loaded Configuration File:         /usr/local/lib/php.ini
    Scan for additional .ini files in: /etc/centminmod/php.d
    Additional .ini files parsed:      /etc/centminmod/php.d/apcu.ini,
    /etc/centminmod/php.d/curlcainfo.ini,
    /etc/centminmod/php.d/custom.ini,
    /etc/centminmod/php.d/custom_php.ini,
    /etc/centminmod/php.d/geoip.ini,
    /etc/centminmod/php.d/igbinary.ini,
    /etc/centminmod/php.d/imagick.ini,
    /etc/centminmod/php.d/memcache.ini,
    /etc/centminmod/php.d/memcached.ini,
    /etc/centminmod/php.d/newrelic.ini,
    /etc/centminmod/php.d/zendopcache.ini
     
  5. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    10:07 PM
    Mainline
    10.2
    Yes that's what I reported earlier :)
    After PHP upgrade it creates a brand new custom_php.ini.
     
  6. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yes related to new Centmin Mod .08 beta php custom tweaks where moved from php.ini to custom_php.ini in inc/phpsededit.inc

    line 5 creates a backup of old custom_php.ini-bak-$DT
     
  7. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    easy way to work around this is make sure your own custom ini is changed alphabetically after custom_php.ini

    just this this on the forums with /etc/centminmod/php.d/custom_php2.ini
    Code:
    php --ini
    Configuration File (php.ini) Path: /usr/local/lib
    Loaded Configuration File:         /usr/local/lib/php.ini
    Scan for additional .ini files in: /etc/centminmod/php.d
    Additional .ini files parsed:      /etc/centminmod/php.d/apcu.ini,
    /etc/centminmod/php.d/curlcainfo.ini,
    /etc/centminmod/php.d/custom_php.ini,
    /etc/centminmod/php.d/custom_php2.ini,
    /etc/centminmod/php.d/geoip.ini,
    /etc/centminmod/php.d/igbinary.ini,
    /etc/centminmod/php.d/imagick.ini,
    /etc/centminmod/php.d/memcache.ini,
    /etc/centminmod/php.d/memcached.ini,
    /etc/centminmod/php.d/newrelic.ini,
    /etc/centminmod/php.d/zendopcache.ini
     
  8. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    10:07 PM
    Mainline
    10.2
    Then I will add my own customization's on custom_php2.ini file?
    Thanks!
     
  9. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yup
     
  10. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    5:07 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    Today i got a 502 when i visit the forum here :(

    About 5 minutes before this post :(
     
  11. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  12. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    5:07 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    I just upgrade to latest 5.6.4 and is working fine :)

    I just got this at the end :

    Code:
    cat: /root/centminlogs/zendopcache_passfile.txt: No such file or directory
     
  13. Andy

    Andy Active Member

    540
    89
    28
    Aug 6, 2014
    Ratings:
    +132
    Local Time:
    9:07 AM
    Everytime I update centminmod, I have to manually edit the centmin.sh to change the IPV6 to 'y' and the timezone.
    Is there anyway I can add those changes to the custom_php2.ini?
     
  14. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Unfortunately, php.ini can't set the ipv6 which is for Nginx and timezone for PHP is set via inc/phpsededit.inc line 17. It's a bit hard to set it for PHP timezones as not all timezone codes match CentOS timezone codes for system, so it's harder or almost impossible to determine every user's timezone for their system and apply the right PHP timezone code. Which is why it defaults to UTC
     
  15. Andy

    Andy Active Member

    540
    89
    28
    Aug 6, 2014
    Ratings:
    +132
    Local Time:
    9:07 AM
    Any reason why we don't set ipv6 support on by default?
     
  16. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:07 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    oh actually, you can set PHP timezone yourself via custom_php2.ini

    Code:
    date.timezone = UTC
    which would stick

    but I can't do it automatically via centmin.sh

    As to ipv6, your server needs to have ipv6 support/addresses for it. But not all servers have it. Only 3 out of 30 of my servers have ipv6 enabled.
     
  17. sepulchre

    sepulchre Member

    167
    22
    18
    Dec 22, 2014
    Ratings:
    +28
    Local Time:
    4:07 PM
    Newbie here, so I wanted to update php. So, is 5.6.4 safe or should I go with 5.6.3 instead?
     
  18. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    5:07 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    Yes it is safe to use :)

    Just use latest centminmod 0.8 beta :)
     
  19. sepulchre

    sepulchre Member

    167
    22
    18
    Dec 22, 2014
    Ratings:
    +28
    Local Time:
    4:07 PM
    Is it a good idea to use the beta? Keep in mind this is my first install/upgrade ever. Stable versions are welcomed :).

    Anyway, I read this article but I dont understand how to upgrade from CMM 0.7 to 0.8. Can someone explain me?

    So, if I go with CMM 0.8, I can go with PHP 5.6.4, else I should stick to PHP 5.6.3?
     
  20. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    5:07 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    You can upgrade using:

    branchname=123.08centos7beta01
    rm -rf /usr/local/src/${branchname}.zip
    rm -rf /usr/local/src/centminmod-${branchname}
    wget -O /usr/local/src/${branchname}.zip https://github.com/centminmod/centminmod/archive/${branchname}.zip
    cd /usr/local/src
    unzip ${branchname}.zip
    cd centminmod-${branchname}
    chmod +x centmin.sh

    And i think is ok to move to latest php version but i am new also to Centmimod so maybe you must wait for more recommendations...

    On all my centminmod servers i am using the beta version and is fine and on my second Centminmod server i am using latest php 5.6.4 without any problems.