Want more timely Centmin Mod News Updates?
Become a Member

502 Bad Gateway

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by adamus007p, Dec 23, 2022.

  1. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    10:21 AM
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed:123.09beta01.b760
      Nginx Version Installed: 1.21.4
    • PHP Version Installed: 8.0.14
    • When was last time updated Centmin Mod code base ? : today
    • Persistent Config:
    Code (Text):
    CF_DNSAPI_GLOBAL='y'
    CF_Token="xxxxxxxxxxxx"
    CF_Account_ID="xxxxxxxxxxxxxxxx"
    NGINX_SSLCACHE_ALLOWOVERRIDE='y'
    NGINX_STAPLE_CACHE_OVERRIDE='y'
    NGINX_STAPLE_CACHE_TTL='86400'
    SET_DEFAULT_MYSQLCHARSET='utf8mb4'
    AUTOHARDTUNE_NGINXBACKLOG='y'
    ZSTD_LOGROTATE_NGINX='y'
    ZSTD_LOGROTATE_PHPFPM='y'
    NGINX_LIBBROTLI='y'
    NGXDYNAMIC_BROTLI='y'
    PHP_PGO='y'
    PHP_BROTLI='y'
    PHP_LZFOUR='y'
    PHP_LZF='y'
    PHP_ZSTD='y'
    MARCH_TARGETNATIVE='n'
    LETSENCRYPT_DETECT='y'
    DUALCERTS='y'
    AUDITD_ENABLE='y'
    PHPINTL='y'
    PHPFINFO='y'
    LIBRESSL_SWITCH='n'
    DMOTD_PHPCHECK='y'
    WPCLI_CE_QUERYSTRING_INCLUDED='y'
    NGINX_ZERODT='y'



    I was making update php 7.4.32 to
    Code (Text):
    php -v
    PHP 7.4.33 (cli) (built: Dec 22 2022 18:17:44) PGO ( NTS DEBUG )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
        with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
    


    and there is 502 Bad Gateway but only regards the admin not front office.

    I was trying to back to 7.4.32 but it doesn't helped.

    So my website (front office) is working but backoffice not.

    What could be happened? Any idea how to find that is the problem?
    I was testing with APCu maybe I mess something.

    Code (Text):
    tail -10 /home/nginx/domains/domain.com/log/error.log
    
    2022/12/22 20:13:29 [error] 46350#46350: *23 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxxxxxx, server: domain.com, request: "GET /admin/index.php/sell/orders/?_token=2stHOxxxxxx HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com", referrer: "https://www.domain.com/admin/index.php/security/compromised?uri=https%253A%252F%252Fwww.domain.com%252Fadmin%252Findex.php%252Fsellxxxxxx"
    



    Code (Text):
     fpmrestart
    Restarting php-fpm (via systemctl) [  OK  ]
    



    Code (Text):
    tail -10 /usr/local/nginx/logs/error.log
    2022/12/22 20:11:20 [warn] 46347#46347: duplicate extension "eot", content type: "application/vnd.ms-fontobject", previous content type: "application/vnd.ms-fontobject" in /usr/local/nginx/conf/mime.types:105
    2022/12/22 20:11:20 [warn] 46347#46347: duplicate extension "ttf", content type: "application/x-font-ttf", previous content type: "application/x-font-ttf" in /usr/local/nginx/conf/mime.types:106
    2022/12/22 20:11:20 [warn] 46347#46347: duplicate extension "otf", content type: "font/opentype", previous content type: "font/opentype" in /usr/local/nginx/conf/mime.types:107
    2022/12/22 20:11:20 [warn] 46347#46347: duplicate extension "woff2", content type: "application/font-woff2", previous content type: "application/font-woff2" in /usr/local/nginx/conf/mime.types:108
    2022/12/22 20:11:20 [warn] 46347#46347: duplicate MIME type "application/x-font-ttf" in /home/nginx/domains/domain.com/nginx.conf:67
    2022/12/22 20:11:20 [warn] 46347#46347: duplicate MIME type "font/ttf" in /home/nginx/domains/domain.com/nginx.conf:67
    2022/12/22 20:11:20 [warn] 46347#46347: duplicate MIME type "font/opentype" in /home/nginx/domains/domain.com/nginx.conf:67
    2022/12/22 20:11:20 [warn] 46347#46347: duplicate MIME type "application/x-font-ttf" in /home/nginx/domains/domain.com/nginx.conf:67
    2022/12/22 20:11:20 [warn] 46347#46347: duplicate MIME type "font/ttf" in /home/nginx/domains/domain.com/nginx.conf:67
    2022/12/22 20:11:20 [warn] 46347#46347: duplicate MIME type "font/opentype" in /home/nginx/domains/domain.com/nginx.conf:67
    [20:22][root@host.domain.com ~]# tail -10 /var/log/mysqld.log
    [20:23][root@host.domain.com ~]#




    Previous time I had
    Code (Text):
    Memcached server stopped
    Memcached server started
    
    Redirecting to /bin/systemctl restart php-fpm.service
    
    Dec 16 12:55:42 host.domain.com php-fpm[22970]: Unknown(0) : Warning - PHP Startup: Unable to load dynamic library 'brotli.so' (tried: /usr/local/lib/php/extensions/debug-non-zts-20190902/brotli.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/brotli.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/debug-non-zts-20190902/brotli.so.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/brotli.so.so: cannot open shared object file: No such file or directory))
    Dec 16 12:55:42 host.domain.com php-fpm[22970]: [16-Dec-2022 12:55:42] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'lz4.so' (tried: /usr/local/lib/php/extensions/debug-non-zts-20190902/lz4.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/lz4.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/debug-non-zts-20190902/lz4.so.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/lz4.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    Dec 16 12:55:42 host.domain.com php-fpm[22970]: Unknown(0) : Warning - PHP Startup: Unable to load dynamic library 'lz4.so' (tried: /usr/local/lib/php/extensions/debug-non-zts-20190902/lz4.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/lz4.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/debug-non-zts-20190902/lz4.so.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/lz4.so.so: cannot open shared object file: No such file or directory))
    Dec 16 12:55:42 host.domain.com php-fpm[22970]: [16-Dec-2022 12:55:42] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'lzf.so' (tried: /usr/local/lib/php/extensions/debug-non-zts-20190902/lzf.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/lzf.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/debug-non-zts-20190902/lzf.so.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/lzf.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    Dec 16 12:55:42 host.domain.com php-fpm[22970]: Unknown(0) : Warning - PHP Startup: Unable to load dynamic library 'lzf.so' (tried: /usr/local/lib/php/extensions/debug-non-zts-20190902/lzf.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/lzf.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/debug-non-zts-20190902/lzf.so.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/lzf.so.so: cannot open shared object file: No such file or directory))
    Dec 16 12:55:42 host.domain.com php-fpm[22970]: [16-Dec-2022 12:55:42] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'mailparse.so' (tried: /usr/local/lib/php/extensions/debug-non-zts-20190902/mailparse.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/mailparse.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/debug-non-zts-20190902/mailparse.so.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/mailparse.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    Dec 16 12:55:42 host.domain.com php-fpm[22970]: Unknown(0) : Warning - PHP Startup: Unable to load dynamic library 'mailparse.so' (tried: /usr/local/lib/php/extensions/debug-non-zts-20190902/mailparse.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/mailparse.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/debug-non-zts-20190902/mailparse.so.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/mailparse.so.so: cannot open shared object file: No such file or directory))
    Dec 16 12:55:42 host.domain.com php-fpm[22970]: [16-Dec-2022 12:55:42] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/local/lib/php/extensions/debug-non-zts-20190902/redis.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/redis.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/debug-non-zts-20190902/redis.so.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    Dec 16 12:55:42 host.domain.com php-fpm[22970]: Unknown(0) : Warning - PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/local/lib/php/extensions/debug-non-zts-20190902/redis.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/redis.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/debug-non-zts-20190902/redis.so.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/redis.so.so: cannot open shared object file: No such file or directory))
    Dec 16 12:55:42 host.domain.com php-fpm[22970]: [16-Dec-2022 12:55:42] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'zstd.so' (tried: /usr/local/lib/php/extensions/debug-non-zts-20190902/zstd.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/zstd.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/debug-non-zts-20190902/zstd.so.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/zstd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    Dec 16 12:55:42 host.domain.com php-fpm[22970]: Unknown(0) : Warning - PHP Startup: Unable to load dynamic library 'zstd.so' (tried: /usr/local/lib/php/extensions/debug-non-zts-20190902/zstd.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/zstd.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/debug-non-zts-20190902/zstd.so.so (/usr/local/lib/php/extensions/debug-non-zts-20190902/zstd.so.so: cannot open shared object file: No such file or directory))
    Dec 16 12:55:42 host.domain.com systemd[1]: php-fpm.service: Supervising process 22971 which is not our child. We'll most likely not notice when it exits.
    Dec 16 12:55:42 host.domain.com systemd[1]: Started PHP FastCGI Process Manager.
    -- Subject: Unit php-fpm.service has finished start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit php-fpm.service has finished starting up.
    --
    -- The start-up result is done.
    
    memcached -V
    memcached 1.6.5





    In the log I can see
    Code (Text):
    PGO phpbench setup end
    
    ./sapi/cgi/php-cgi -T10 /svr-setup/phpbench/phpbench.php
    PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /opt/phpbench/tests/test_switch.php on line 36
    /opt/phpbench/tests/test_switch.php(36) : Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
    PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; TestLocalObjectAssign has a deprecated constructor in /opt/phpbench/tests/test_local_object_assign.php on line 3
    /opt/phpbench/tests/test_local_object_assign.php(3) : Deprecated - Methods with the same name as their class will not be constructors in a future version of PHP; TestLocalObjectAssign has a deprecated constructor
    Status: 500 Internal Server Error
    Content-type: text/html; charset=UTF-8
    
    
    PHPBench version 0.8.1
    
    -f <file name> : Output a summary as a CSV file.
    -h             : Help.
    -i <number>    : Number of iterations (default=100000).
    
    Scripts are loaded from the following directories:
      - /usr/local/lib/phpbench/tests
      - /usr/local/share/phpbench/tests
      - /usr/lib/phpbench/tests
      - /usr/share/phpbench/tests
      - /opt/phpbench/tests
      - tests
      - .
    
    Starting the benchmark with 100000 iterations.
    
    Test [test_ord] enabled.
    Test [test_local_integer_assign] enabled.
    Test [test_local_array_assign] enabled.
    Test [test_local_scalar_assign] enabled.
    Test [test_do_while_break] enabled.
    Test [test_chr_hardcoded] enabled.
    Test [test_variable_variables] enabled.
    Test [test_local_string_assign] enabled.
    Test [test_while] enabled.
    Test [test_switch] enabled.
    Test [test_crc32] enabled.
    Test [test_compare_invert] enabled.
    Test [test_references] enabled.
    Test [test_is_type] enabled.
    Test [test_local_hash_assign] enabled.
    Test [test_chr_fixed] enabled.
    Test [test_do_while] enabled.
    Test [test_ereg] enabled.
    Test [test_ordered_functions_references] enabled.
    Test [test_is_object] enabled.
    Test [test_local_object_assign] enabled.
    Test [test_preg_match] enabled.
    Test [test_empty_loop] enabled.
    Test [test_global_scalar_assign] enabled.
    Test [test_global_string_assign] enabled.
    Test [test_compare] enabled.
    Test [test_string_append] enabled.
    Test [test_chr_var] enabled.
    Test [test_rand] enabled.
    Test [test_compare_unstrict] enabled.
    Test [test_constants] enabled.
    Test [test_arithmetic] enabled.
    Test [test_casting] enabled.
    Test [test_isset] enabled.
    Test [test_empty] enabled.
    Test [test_sha1] enabled.
    Test [test_mt_rand] enabled.
    Test [test_comment_loop] enabled.
    Test [test_local_boolean_assign] enabled.
    Test [test_compare_strict] enabled.
    Test [test_microtime] enabled.
    Test [test_bitwise] enabled.
    Test [test_if_constant] enabled.
    Test [test_get_class] enabled.
    Test [test_md5] enabled.
    Test [test_is_array] enabled.
    Test [test_compare_false] enabled.
    Test [test_unordered_functions] enabled.
    Test [test_strlen] enabled.
    Test [test_time] enabled.
    Test [test_increment] enabled.
    Test [test_line] enabled.
    Test [test_ordered_functions] enabled.
    Test [test_local_float_assign] enabled.
    Test [test_array_operators] enabled.
    Test [test_foreach] enabled.
    Status: 500 Internal Server Error
    Content-type: text/html; charset=UTF-8
    
    
    PHPBench version 0.8.1
    
    -f <file name> : Output a summary as a CSV file.
    -h             : Help.
    -i <number>    : Number of iterations (default=100000).
    
    Scripts are loaded from the following directories:
      - /usr/local/lib/phpbench/tests
      - /usr/local/share/phpbench/tests
      - /usr/lib/phpbench/tests
      - /usr/share/phpbench/tests
      - /opt/phpbench/tests
      - tests
      - .
    
    Starting the benchmark with 100000 iterations.
    
    Test [test_ord] enabled.
    Test [test_local_integer_assign] enabled.
    Test [test_local_array_assign] enabled.
    Test [test_local_scalar_assign] enabled.
    Test [test_do_while_break] enabled.
    Test [test_chr_hardcoded] enabled.
    Test [test_variable_variables] enabled.
    Test [test_local_string_assign] enabled.
    Test [test_while] enabled.
    Test [test_switch] enabled.
    Test [test_crc32] enabled.
    Test [test_compare_invert] enabled.
    Test [test_references] enabled.
    Test [test_is_type] enabled.
    Test [test_local_hash_assign] enabled.
    Test [test_chr_fixed] enabled.
    Test [test_do_while] enabled.
    Test [test_ereg] enabled.
    Test [test_ordered_functions_references] enabled.
    Test [test_is_object] enabled.
    Test [test_local_object_assign] enabled.
    Test [test_preg_match] enabled.
    Test [test_empty_loop] enabled.
    Test [test_global_scalar_assign] enabled.
    Test [test_global_string_assign] enabled.
    Test [test_compare] enabled.
    Test [test_string_append] enabled.
    Test [test_chr_var] enabled.
    Test [test_rand] enabled.
    Test [test_compare_unstrict] enabled.
    Test [test_constants] enabled.
    Test [test_arithmetic] enabled.
    Test [test_casting] enabled.
    Test [test_isset] enabled.
    Test [test_empty] enabled.
    Test [test_sha1] enabled.
    Test [test_mt_rand] enabled.
    Test [test_comment_loop] enabled.
    Test [test_local_boolean_assign] enabled.
    Test [test_compare_strict] enabled.
    Test [test_microtime] enabled.
    Test [test_bitwise] enabled.
    Test [test_if_constant] enabled.
    Test [test_get_class] enabled.
    Test [test_md5] enabled.
    Test [test_is_array] enabled.
    Test [test_compare_false] enabled.
    Test [test_unordered_functions] enabled.
    Test [test_strlen] enabled.
    Test [test_time] enabled.
    Test [test_increment] enabled.
    Test [test_line] enabled.
    Test [test_ordered_functions] enabled.
    Test [test_local_float_assign] enabled.
    Test [test_array_operators] enabled.
    Test [test_foreach] enabled.
    Status: 500 Internal Server Error
    Content-type: text/html; charset=UTF-8
    
    
    PHPBench version 0.8.1
    
    -f <file name> : Output a summary as a CSV file.
    -h             : Help.
    -i <number>    : Number of iterations (default=100000).
    
    Scripts are loaded from the following directories:
      - /usr/local/lib/phpbench/tests
      - /usr/local/share/phpbench/tests
      - /usr/lib/phpbench/tests
      - /usr/share/phpbench/tests
      - /opt/phpbench/tests
      - tests
      - .
    
    Starting the benchmark with 100000 iterations.
    
    Test [test_ord] enabled.
    Test [test_local_integer_assign] enabled.
    Test [test_local_array_assign] enabled.
    Test [test_local_scalar_assign] enabled.
    Test [test_do_while_break] enabled.
    Test [test_chr_hardcoded] enabled.
    Test [test_variable_variables] enabled.
    Test [test_local_string_assign] enabled.
    Test [test_while] enabled.
    Test [test_switch] enabled.
    Test [test_crc32] enabled.
    Test [test_compare_invert] enabled.
    Test [test_references] enabled.
    Test [test_is_type] enabled.
    Test [test_local_hash_assign] enabled.
    Test [test_chr_fixed] enabled.
    Test [test_do_while] enabled.
    Test [test_ereg] enabled.
    Test [test_ordered_functions_references] enabled.
    Test [test_is_object] enabled.
    Test [test_local_object_assign] enabled.
    Test [test_preg_match] enabled.
    Test [test_empty_loop] enabled.
    Test [test_global_scalar_assign] enabled.
    Test [test_global_string_assign] enabled.
    Test [test_compare] enabled.
    Test [test_string_append] enabled.
    Test [test_chr_var] enabled.
    Test [test_rand] enabled.
    Test [test_compare_unstrict] enabled.
    Test [test_constants] enabled.
    Test [test_arithmetic] enabled.
    Test [test_casting] enabled.
    Test [test_isset] enabled.
    Test [test_empty] enabled.
    Test [test_sha1] enabled.
    Test [test_mt_rand] enabled.
    Test [test_comment_loop] enabled.
    Test [test_local_boolean_assign] enabled.
    Test [test_compare_strict] enabled.
    Test [test_microtime] enabled.
    Test [test_bitwise] enabled.
    Test [test_if_constant] enabled.
    Test [test_get_class] enabled.
    Test [test_md5] enabled.
    Test [test_is_array] enabled.
    Test [test_compare_false] enabled.
    Test [test_unordered_functions] enabled.
    Test [test_strlen] enabled.
    Test [test_time] enabled.
    Test [test_increment] enabled.
    Test [test_line] enabled.
    Test [test_ordered_functions] enabled.
    Test [test_local_float_assign] enabled.
    Test [test_array_operators] enabled.
    Test [test_foreach] enabled.
    Status: 500 Internal Server Error
    Content-type: text/html; charset=UTF-8
    
    
    PHPBench version 0.8.1
    



    in /etc/centminmod/php.d/
    mailparse.ini
    zstd.ini
    lzf.ini
    lz4.ini
    brotli.ini
    redis.ini
    16. Dec 2022

    are with the date when I was trying to update php to the newest vesrion.
    After my anoter try to update it, it is not upadted.

    other files are updated with the date:
    timezonedb.ini
    mcrypt.ini
    igbinary.ini
    imagick.ini
    geoip.ini
    zendopcache.ini
    curlcainfo.ini
    a_customphp.ini
    memcache.ini
    a_customphp.ini-bak_221222-202938
    memcached.ini
    22.12.2022
     
    Last edited: Dec 23, 2022
  2. eva2000

    eva2000 Administrator Staff Member

    54,336
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    7:21 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    What if you disable PGO for PHP-FPM with PHP_PGO='n' ?

    To troubleshooting PHP recompile/upgrade/downgrade routines see https://community.centminmod.com/threads/how-to-troubleshoot-php-installs-upgrades.17857/

    Code (Text):
    2022/12/22 20:11:20 [warn] 46347#46347: duplicate MIME type "application/x-font-ttf" in /home/nginx/domains/domain.com/nginx.conf:67
    
    why would you have an nginx.conf config file at /home/nginx/domains/domain.com/nginx.conf ? that isn't a standard Centmin Mod default nginx.conf which belongs. If you have drastically changed Centmin Mod config files/locations. I'd create a 2nd test fresh Centmin Mod VPS and setup a copy of site on that test fresh Centmin Mod VPS and see if you can reproduce issues with default Centmin Mod VPS configuration/files untouched by your modifications first and then work backwards on the problematic Centmin Mod install and reverse such changes and see if that helps.
     
  3. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    10:21 AM
    No effect the same.



    In /usr/local/nginx/conf/conf.d/domain.com.ssl

    I have add

    Code (Text):
        location ~* \.(xml|xsl)$ { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }
    location /robots.txt { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }
    location ~* \.(css|js|pdf)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=2592000, stale-while-revalidate=86400, stale-if-error=604800"; expires 30d; }
    location ~* \.(jpg|jpeg|png|gif|ico|eot|swf|svg|webp|avif|ttf|otf|woff|woff2|ogg|mp4|mpeg|avi|mkv|webm|mp3)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800"; expires 365d; }
    location /wp-cron.php { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; }
    location = /blog/wp-content/wp-cloudflare-super-page-cache/www.domain.com/debug.log { access_log off; deny all; }
    #super cache plugin


    to enable WebP.

    I have created a 2nd VPS as clone of the one where is the problem.

    But I have no idea why the problem is only with the backoffice not with front office.


    That include /home/nginx/domains/domain.com/nginx.conf; is extra include outside the config folder. I have delete is but it did not helped.



    PHP recompile/upgrade/downgrade:
    There is change fatal error when upgrade to php8.0 so something is change.
    Fatal error as this app version do not support php8.0 yet. So it seems be running on php8.0.
    It is very weird when front works on php7.4 but backend do not works.

    When I have back to 7.4 or 7.3 there is an error.
     
    Last edited: Dec 25, 2022
  4. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    10:21 AM
    Code (Text):
     tail -10 /home/nginx/domains/domain.com/log/error.log
    2022/12/25 21:59:25 [error] 1692#1692: *270 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxxxx, server: domain.com, request: "GET /backoffice/index.php?controller=AdminLogin&token=xxxxx HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com"
    2022/12/25 22:17:20 [error] 1692#1692: *272 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxxxx, server: domain.com, request: "GET /backoffice/index.php?controller=AdminLogin&token=xxxxx HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com"
    2022/12/25 22:22:45 [error] 4066#4066: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxxxx, server: domain.com, request: "GET /backoffice/index.php?controller=AdminLogin&token=xxxxx HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com"
    2022/12/25 22:22:47 [error] 4066#4066: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxxxx, server: domain.com, request: "GET /backoffice/index.php?controller=AdminLogin&token=xxxxx HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com"
    2022/12/25 22:22:48 [error] 4066#4066: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxxxx, server: domain.com, request: "GET /backoffice/index.php?controller=AdminLogin&token=xxxxx HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com"
    2022/12/25 22:30:47 [error] 4067#4067: *6 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxxxx, server: domain.com, request: "GET /backoffice/index.php?controller=AdminLogin&token=xxxxx HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com"
    



    I recompile with
    Code (Text):
    PHP_PGO_ALWAYS='n'
    PHP_PGO='n'

    and it helped, not I have other errors from memcached server but it looks it is from software.


    I thought before that downgrade and update was successfully but not.

    I will do test with PDO and I will update results later.
     
    Last edited: Dec 26, 2022
  5. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    10:21 AM
    Update:
    My final tests shows that I need to turn off PGO
    Code (Text):
    PHP_PGO_ALWAYS='n'
    PHP_PGO='n'


    AND downgrade to php 7.3.33

    When I turn off only PDO and recompite php (7.4.33) doesn't help.


    I can also downgrade php 7.3.33 (PGO off) and update to 7.4.33 (PGO off) it also works.

    I see that there is some error during PGO on, logs below:
    Code (Text):
    Starting the benchmark with 100000 iterations.
    
    Test [test_ord] enabled.
    Test [test_local_integer_assign] enabled.
    Test [test_local_array_assign] enabled.
    Test [test_local_scalar_assign] enabled.
    Test [test_do_while_break] enabled.
    Test [test_chr_hardcoded] enabled.
    Test [test_variable_variables] enabled.
    Test [test_local_string_assign] enabled.
    Test [test_while] enabled.
    Test [test_switch] enabled.
    Test [test_crc32] enabled.
    Test [test_compare_invert] enabled.
    Test [test_references] enabled.
    Test [test_is_type] enabled.
    Test [test_local_hash_assign] enabled.
    Test [test_chr_fixed] enabled.
    Test [test_do_while] enabled.
    Test [test_ereg] enabled.
    Test [test_ordered_functions_references] enabled.
    Test [test_is_object] enabled.
    Test [test_local_object_assign] enabled.
    Test [test_preg_match] enabled.
    Test [test_empty_loop] enabled.
    Test [test_global_scalar_assign] enabled.
    Test [test_global_string_assign] enabled.
    Test [test_compare] enabled.
    Test [test_string_append] enabled.
    Test [test_chr_var] enabled.
    Test [test_rand] enabled.
    Test [test_compare_unstrict] enabled.
    Test [test_constants] enabled.
    Test [test_arithmetic] enabled.
    Test [test_casting] enabled.
    Test [test_isset] enabled.
    Test [test_empty] enabled.
    Test [test_sha1] enabled.
    Test [test_mt_rand] enabled.
    Test [test_comment_loop] enabled.
    Test [test_local_boolean_assign] enabled.
    Test [test_compare_strict] enabled.
    Test [test_microtime] enabled.
    Test [test_bitwise] enabled.
    Test [test_if_constant] enabled.
    Test [test_get_class] enabled.
    Test [test_md5] enabled.
    Test [test_is_array] enabled.
    Test [test_compare_false] enabled.
    Test [test_unordered_functions] enabled.
    Test [test_strlen] enabled.
    Test [test_time] enabled.
    Test [test_increment] enabled.
    Test [test_line] enabled.
    Test [test_ordered_functions] enabled.
    Test [test_local_float_assign] enabled.
    Test [test_array_operators] enabled.
    Test [test_foreach] enabled.
    Status: 500 Internal Server Error <<<<<<<<<<<<<<<<<<
    Content-type: text/html; charset=UTF-8
    
    
    PHPBench version 0.8.1
    
    -f <file name> : Output a summary as a CSV file.
    -h             : Help.
    -i <number>    : Number of iterations (default=100000).
    
    Scripts are loaded from the following directories:
      - /usr/local/lib/phpbench/tests
      - /usr/local/share/phpbench/tests
      - /usr/lib/phpbench/tests
      - /usr/share/phpbench/tests
      - /opt/phpbench/tests
      - tests
      - .
    
    Starting the benchmark with 100000 iterations.
    




    I have also was trying combination
    Code (Text):
    PHP_PGO_ALWAYS='n'
    PHP_PGO='n'
    
    PHP_PGO_ALWAYS='y'
    PHP_PGO='n'
    
    PHP_PGO_ALWAYS='n'
    PHP_PGO='y'
    
    PHP_PGO_ALWAYS='y'
    PHP_PGO='y'
    


    and only
    Code (Text):
    PHP_PGO_ALWAYS='n'
    PHP_PGO='n'

    works


    my custom config file is:
    Code (Text):
    CF_DNSAPI_GLOBAL='y'
    CF_Token="xxxxxx"
    CF_Account_ID="xxxxxxxxxx"
    NGINX_SSLCACHE_ALLOWOVERRIDE='y'
    NGINX_STAPLE_CACHE_OVERRIDE='y'
    NGINX_STAPLE_CACHE_TTL='86400'
    SET_DEFAULT_MYSQLCHARSET='utf8mb4'
    AUTOHARDTUNE_NGINXBACKLOG='y'
    ZSTD_LOGROTATE_NGINX='y'
    ZSTD_LOGROTATE_PHPFPM='y'
    NGINX_LIBBROTLI='y'
    NGXDYNAMIC_BROTLI='y'
    PHP_PGO='n'
    PHP_BROTLI='y'
    PHP_LZFOUR='y'
    PHP_LZF='y'
    PHP_ZSTD='y'
    MARCH_TARGETNATIVE='n'
    LETSENCRYPT_DETECT='y'
    DUALCERTS='y'
    AUDITD_ENABLE='y'
    PHPINTL='y'
    PHPFINFO='y'
    LIBRESSL_SWITCH='n'
    DMOTD_PHPCHECK='y'
    WPCLI_CE_QUERYSTRING_INCLUDED='y'
    NGINX_ZERODT='y'
    PHPDEBUGMODE=y
    ACMEDEBUG='y'
    SELFSIGNEDSSL_ECDSA='y'



    Code (Text):
     php -v
    PHP 7.3.33 (cli) (built: Dec 27 2022 12:01:51) ( NTS DEBUG )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.3.33, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.3.33, Copyright (c) 1999-2018, by Zend Technologies
    
     
    Last edited: Dec 27, 2022
  6. eva2000

    eva2000 Administrator Staff Member

    54,336
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    7:21 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Then use that combination which is default out the box for Centmin Mod. Seems your web PHP app doesn't like PGO then.
     
  7. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    10:21 AM
    I have used this combination but with downgrade and it helped.

    Later I can upgrade it again but with no PGO.
     
  8. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    10:21 AM
    @eva2000 Cd. I have update my application and when I go to back office I see error:

    Code (Text):
    php-cgi: /svr-setup/php-8.1.13/Zend/zend_object_handlers.c:503: zend_check_property_access: Assertion `property_info->flags & (1 << 1)' failed.


    PGO is off, my custom config file is above, any idea how to fix it?
     
  9. eva2000

    eva2000 Administrator Staff Member

    54,336
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    7:21 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Sounds like your PHP web app code issue, so contact your PHP web app developer and ask :)
     
  10. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    10:21 AM
    The problem starts when I was trying to update php. Now I have installed new server and fresh centminmod installation and I will check there.
     
  11. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    10:21 AM
    In php 7.4 I have delete this from the config file:

    Code (Text):
    PHPDEBUGMODE=y


    and even with PDO everything is working OK.


    so the problem was cased by this:
    Code (Text):
    PHPDEBUGMODE=y
     
  12. eva2000

    eva2000 Administrator Staff Member

    54,336
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    7:21 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    PHPDEBUGMODE enabled on list debug PHP-FPM warnings etc so what you see might just be warnings that do not necessarily impact PHP-FPM operations usually rather than prevent PHP from working.
     
  13. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    10:21 AM
    With PHPDEBUGMODE enabled the PGO was not working. There was 502 Bad Gateway.

    Without PHPDEBUGMODE everything is OK.

    It was somehow impacting into PGO. The same was regards different versions of the PHP.