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. rdan

    rdan Premium Member Premium Member

    4,308
    1,044
    113
    May 25, 2014
    Ratings:
    +1,504
    Local Time:
    7:53 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

    36,422
    7,994
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,308
    Local Time:
    9:53 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    then i am experiencing a different bug in PHP 5.6.4 heh
     
  3. rdan

    rdan Premium Member Premium Member

    4,308
    1,044
    113
    May 25, 2014
    Ratings:
    +1,504
    Local Time:
    7:53 PM
    Mainline
    10.2
    That's not a bug, but maybe you missed some other things :)
     
  4. eva2000

    eva2000 Administrator Staff Member

    36,422
    7,994
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,308
    Local Time:
    9:53 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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:
    [[email protected] 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 Premium Member Premium Member

    4,308
    1,044
    113
    May 25, 2014
    Ratings:
    +1,504
    Local Time:
    7:53 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

    36,422
    7,994
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,308
    Local Time:
    9:53 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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

    36,422
    7,994
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,308
    Local Time:
    9:53 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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
     
    • Like Like x 2
  8. rdan

    rdan Premium Member Premium Member

    4,308
    1,044
    113
    May 25, 2014
    Ratings:
    +1,504
    Local Time:
    7:53 PM
    Mainline
    10.2
    Then I will add my own customization's on custom_php2.ini file?
    Thanks!
     
  9. eva2000

    eva2000 Administrator Staff Member

    36,422
    7,994
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,308
    Local Time:
    9:53 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Yup
     
  10. pamamolf

    pamamolf Well-Known Member

    3,117
    295
    83
    May 31, 2014
    Ratings:
    +530
    Local Time:
    2:53 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Today i got a 502 when i visit the forum here :(

    About 5 minutes before this post :(
     
  11. eva2000

    eva2000 Administrator Staff Member

    36,422
    7,994
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,308
    Local Time:
    9:53 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  12. pamamolf

    pamamolf Well-Known Member

    3,117
    295
    83
    May 31, 2014
    Ratings:
    +530
    Local Time:
    2:53 PM
    Nginx-1.13.x
    MariaDB 10.1.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 Premium Member Premium Member

    420
    60
    28
    Aug 6, 2014
    Ratings:
    +84
    Local Time:
    7:53 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

    36,422
    7,994
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,308
    Local Time:
    9:53 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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
     
    • Like Like x 1
  15. Andy

    Andy Premium Member Premium Member

    420
    60
    28
    Aug 6, 2014
    Ratings:
    +84
    Local Time:
    7:53 AM
    Any reason why we don't set ipv6 support on by default?
     
  16. eva2000

    eva2000 Administrator Staff Member

    36,422
    7,994
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,308
    Local Time:
    9:53 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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.
     
    • Like Like x 2
  17. sepulchre

    sepulchre Member

    108
    18
    18
    Dec 22, 2014
    Ratings:
    +21
    Local Time:
    1:53 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 Well-Known Member

    3,117
    295
    83
    May 31, 2014
    Ratings:
    +530
    Local Time:
    2:53 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Yes it is safe to use :)

    Just use latest centminmod 0.8 beta :)
     
    • Like Like x 1
  19. sepulchre

    sepulchre Member

    108
    18
    18
    Dec 22, 2014
    Ratings:
    +21
    Local Time:
    1:53 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 Well-Known Member

    3,117
    295
    83
    May 31, 2014
    Ratings:
    +530
    Local Time:
    2:53 PM
    Nginx-1.13.x
    MariaDB 10.1.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.
     
    • Like Like x 1
..