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

How to install PHP 8?

Discussion in 'Install & Upgrades or Pre-Install Questions' started by duderuud, Dec 5, 2020.

  1. duderuud

    duderuud New Member

    16
    3
    3
    Dec 5, 2020
    The Netherlands
    Ratings:
    +7
    Local Time:
    12:54 PM
    1.19.6
    MariaDB 10
    Please fill in any relevant information that applies to you:
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: i.e. 1.19.5
    • PHP Version Installed: 7.4.13
    • When was last time updated Centmin Mod code base ? : latest version
    Want to try PHP 8 but how can I install that?
     
  2. eva2000

    eva2000 Administrator Staff Member

    46,238
    10,510
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,293
    Local Time:
    9:54 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Just like any other PHP version example for PHP 7.3 install at PHP 7.4.11, 7.3.23, 7.2.34 Security Updates + Backported PHP 7.1.33, 7.0.33 & 5.6.40 via centmin.sh menu option 5 Centmin Mod Menu - CentminMod.com LEMP Nginx web stack for CentOS

    Run cmupdate command to ensure latest 123.09beta01 code is on your server and then run centmin.sh menu option 5 specify the exact PHP version you want at prompt i.e. 8.0.0 and then answer yes to Zend Opcache install and hit continue and wait while PHP 8.0.0 is compiled then exit centmin.sh menu via option 24
     
  3. duderuud

    duderuud New Member

    16
    3
    3
    Dec 5, 2020
    The Netherlands
    Ratings:
    +7
    Local Time:
    12:54 PM
    1.19.6
    MariaDB 10
    Ah, that explains it. I tried 8 and 8.0...not 8.0.0 :)

    Thanks!
     
  4. eva2000

    eva2000 Administrator Staff Member

    46,238
    10,510
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,293
    Local Time:
    9:54 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Yeah it's the exact version you want to upgrade or downgrade or recompile for :)
     
  5. duderuud

    duderuud New Member

    16
    3
    3
    Dec 5, 2020
    The Netherlands
    Ratings:
    +7
    Local Time:
    12:54 PM
    1.19.6
    MariaDB 10
    Of course it's better to wait for 8.0.1 or even 8.1 but hey...wanna test stuff :)
     
  6. duderuud

    duderuud New Member

    16
    3
    3
    Dec 5, 2020
    The Netherlands
    Ratings:
    +7
    Local Time:
    12:54 PM
    1.19.6
    MariaDB 10
    Xenforo (basic install with only a few addons) seems to run fine on 8
     
  7. eva2000

    eva2000 Administrator Staff Member

    46,238
    10,510
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,293
    Local Time:
    9:54 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    I take it you're running Xenforo 2.2.2 with PHP 8 support?
     
  8. duderuud

    duderuud New Member

    16
    3
    3
    Dec 5, 2020
    The Netherlands
    Ratings:
    +7
    Local Time:
    12:54 PM
    1.19.6
    MariaDB 10
    Indeed
     
  9. tininho

    tininho Active Member

    141
    36
    28
    May 22, 2019
    Nordic
    Ratings:
    +105
    Local Time:
    1:54 PM
    A vanilla WP 5.6 site that works with PHP 7.4.x does not work with PHP 8.0. Throws a bad gateway 502 error after PHP 8 upgrade

    Code:
    real    0m21.585s
    user    0m21.455s
    sys    0m0.022s
    ./sapi/cgi/php-cgi -T10 /svr-setup/php_pgo_training_scripts/index.php
    PHP Fatal error:  Uncaught ArgumentCountError: parse_str() expects exactly 2 arguments, 1 given in /svr-setup/php_pgo_training_scripts/standard_calls.php:107
    Stack trace:
    #0 /svr-setup/php_pgo_training_scripts/standard_calls.php(107): parse_str()
    #1 /svr-setup/php_pgo_training_scripts/standard_calls.php(70): run_standard_calls()
    #2 /svr-setup/php_pgo_training_scripts/index.php(84): run_standard()
    #3 {main}
      thrown in /svr-setup/php_pgo_training_scripts/standard_calls.php on line 107
    Status: 500 Internal Server Error
    Content-type: text/html; charset=UTF-8
    So PGO is not working with PHP 8? Related to JIT? There are more errors related to /svr-setup/php_pgo_training_scripts/ folder.

    Code:
    WPPLUGINS_ALL='n'
    
    VHOSTCTRL_CLOUDFLAREINC='y'
    CLOUDFLARE_ZLIB='y'
    
    ENABLEMOTD_CSFMSG='n'         # motd banner csf message alert disaply
    ENABLEMOTD_LINKSMSG='n'       # motd centminmod.com links bookmark alert display
    DISABLE_IPVSIX='y'
    
    AUTOTUNE_CLIENTMAXBODY='y'
    
    ## FOR PHP 7.4+
    FPM_WAKEUP_PATCH='y'
    
    AUTODETECPHP_OVERRIDE='y'
     
    ##For Linux Kernel  > 5.1.x
    NGINX_IOURING_PATCH_BETA='y'
    
    ##Upgrading NGINX. Disable, if custom configs
    NGINX_ALLOWOVERRIDE='y'
    
    #NGINX_FATLTO_OBJECTS='n'        # enable -ffat-lto-objects flag for nginx builds - much slower compile times
    #NGINX_NOFATLTO_OBJECTS='n'      # enable -fno-fat-lto-objects flag for nginx builds - much slower compile times
    
    NGINX_DYNAMICTLS='y'
    NGINX_SSLCACHE_ALLOWOVERRIDE='y'  
    NGXDYNAMIC_BROTLI='y'
    NGINX_LIBBROTLI='y'
    AUTOHARDTUNE_NGINXBACKLOG='y'
    
    MARIADB_INSTALLTENFOUR='y'
    SET_DEFAULT_MYSQLCHARSET='utf8mb4'
     
    LETSENCRYPT_DETECT='y'
    DUALCERTS='y'
    NGINX_HPACK='y'
    
    GCC_FALIGN_FUNCTION='y'
    
    LIBRESSL_SWITCH='n'
    CLANG='n'
    DEVTOOLSETSIX='n'
    DEVTOOLSETSEVEN='n'
    DEVTOOLSETEIGHT='n'
    DEVTOOLSETNINE='y'
    NGINX_DEVTOOLSETGCC='y'
    GENERAL_DEVTOOLSETGCC='y'
    CRYPTO_DEVTOOLSETGCC='y'
     
    CUSTOM_CURLRPM='y'
    CUSTOM_CURLRPMVER='7.69.0'       # custom curl/libcurl version
    
    PHP_PGO='y'
    PHP_PGO_ALWAYS='y'
    
    
    PHPPGO_INDEXPATH='/home/nginx/domains/XX/public/index.php'
    #PHPPGO_INDEXPATH_TWO='/home/nginx/domains/XX/public/index.php'
    
    PHP_TUNING='y'
    
    PHP_BROTLI='y'
    PHP_LZFOUR='y'
    PHP_LZF='y'
    PHP_ZSTD='y'
     
    ZSTD_LOGROTATE_NGINX='y'
    ZSTD_LOGROTATE_PHPFPM='y'
     
    MARCH_TARGETNATIVE_ALWAYS='y'
    
    PHPFINFO='y'
    WP_FASTCGI_CACHE='y'
    LETSENCRYPT_DETECT='y'
    PHP_UPDATEMAINTENANCE='y'
    MARIADB_UPDATEMAINTENANCE='y'
    
    SSL_PROTOCOL_MODERN='y'
    #NGINX_MODSECURITY_MAXMIND='y'
    #NGINX_MODSECURITY='y'
    
    WPCLI_CE_QUERYSTRING_INCLUDED='y'
    
    NGINX_STAPLE_CACHE_OVERRIDE='y'
    NGINX_STAPLE_CACHE_TTL='86400'
    
    CF_DNSAPI='y'
    
    
     
  10. eva2000

    eva2000 Administrator Staff Member

    46,238
    10,510
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,293
    Local Time:
    9:54 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    looks like PGO training PHP script itself isn't compatible with PHP 8
    /svr-setup/php_pgo_training_scripts/index.php related to line 107 of standard_calls.php If anyone has PHP / PHP 8 know how and can help with updating centminmod/php_pgo_training_scripts it would be nice too :)

    actually that line is for PHP 7.1 change PHP: parse_str - Manual
    PHP: Backward Incompatible Changes - Manual
    Though this error doesn't prevent PGO optimizations given the PHP 8 PGO performance boosts I have tested.
     
    Last edited: Dec 12, 2020
  11. eva2000

    eva2000 Administrator Staff Member

    46,238
    10,510
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,293
    Local Time:
    9:54 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    That is probably a separate issue from PGO though. If you disable PHP_PGO='n' and compile PHP 8.0.0, do you get 502 errors ?

    check out linked thread at Wordpress - Wordpress 5.6 Released Test You Upgrades First warning Wordpress 5.6 can break a lot in general due to changes in jQuery etc
     
  12. eva2000

    eva2000 Administrator Staff Member

    46,238
    10,510
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,293
    Local Time:
    9:54 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Just made an update to Centmin Mod 123.09beta01 to fix that error for PHP 8.x based PGO installs
     
  13. tininho

    tininho Active Member

    141
    36
    28
    May 22, 2019
    Nordic
    Ratings:
    +105
    Local Time:
    1:54 PM
    I never looked into this more thoroughly, yet. I will toy with Zen3 and Centminmod on the coming days :)