Appropriate PHP Extensions

Discussion in 'WoltLab Burning Board' started by Apparition, Jan 30, 2019.

  1. Apparition

    Apparition Neophyte

    9
    33
    +4
    My host currently uses PHP 5.6 by default, which I know is no longer supported. I can switch it to PHP 7.1 or PHP 7.2, but I have no idea which extensions to select or deselect. The default PHP extension selection is below. Any suggestions?


    Screenshot_PHP Selector extensions.png
     
  2. Paul M

    Paul M Limeade Addict

    3,793
    1,627
    +2,109
    Hard to say as some software will require specific extensions.

    At the very least I would say bcmath, gd, json, mysqli, mysqlind, mbstring, mcrypt, opcache

    Maybe soap, sockets, xmlreader, xmlrpc, xmlrpc.

    Again it really depends on what your system needs to run.
     
  3. eva2000

    eva2000 Habitué

    1,703
    857
    +759
    My usual list for when i setup my own Centmin Mod LEMP stack with PHP 7.2 or 7.3 (php-fpm) right now

    Code:
    php -m
    
    [PHP Modules]
    bcmath
    brotli
    bz2
    calendar
    Core
    ctype
    curl
    date
    dom
    enchant
    exif
    fileinfo
    filter
    ftp
    gd
    geoip
    gettext
    gmp
    hash
    iconv
    igbinary
    imagick
    imap
    intl
    json
    ldap
    libxml
    lz4
    mailparse
    mbstring
    mcrypt
    memcache
    memcached
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    posix
    pspell
    readline
    redis
    Reflection
    session
    shmop
    SimpleXML
    snmp
    soap
    sockets
    SPL
    sqlite3
    standard
    sysvmsg
    sysvsem
    sysvshm
    tidy
    tokenizer
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    Zend OPcache
    zip
    zlib
    zstd
    
     
    • Informative! Informative! x 1
    • List
  4. Paul M

    Paul M Limeade Addict

    3,793
    1,627
    +2,109
    Wow, I dont use about 2/3rds of them, what on earth are you running ?
     
  5. eva2000

    eva2000 Habitué

    1,703
    857
    +759
    As Centmin Mod LEMP stack is for everyone, need to cater for everyones requirements as everyone uses different web app/frameworks etc. Though some listed above are additional to the defaults in Centmin Mod, as I need them for my PHP web app/scripts.

    For example brotli PHP extension needed as I made a Wordpress Autoptimize hook plugin which enables pre-gzip compressed optimised css/js for Nginx pre-gzip static compressed file serving for better performance. Then with help of Wordpress Autoptimize author he provided me code/patch to enable pre-compress brotli compressed hook for css/js generated by Autoptimize plugin to use with Nginx Brotli compression module but this needs brotli PHP extension to be able pre-compress Autopimize generated css/js files.

    This means Nginx with Brotli compression enabled can serve pre-compressed Brotli compressed css/js files and performance difference is huge - up to ~16x times better performance throughput and ~92% faster response time latency than dynamic on the fly Brotli compressed css/js files https://community.centminmod.com/th...tli-compression-level-tests.13820/#post-63601

    Example of wordpress Autoptimized generated css/js files precompressed with gzip and brolti and conditionally served via Nginx depending on if browser supports brotli and fallback to gzip

    brotli PHP extension usage to pre-compress css/js with .br extension
    Code:
    ls -lah wp-content/cache/autoptimize/{css,js}
    wp-content/cache/autoptimize/css:
    total 372K
    drwxr-sr-x 2 nginx nginx 4.0K Oct 16 14:55 .
    drwxr-sr-x 4 nginx nginx 4.0K Oct 16 14:55 ..
    -rw-r--r-- 1 nginx nginx  48K Oct 16 14:55 autoptimize_f735042a33273526fb043c5a87f019d8.css
    -rw-r--r-- 1 nginx nginx 6.6K Oct 16 14:55 autoptimize_f735042a33273526fb043c5a87f019d8.css.br
    -rw-r--r-- 1 nginx nginx 7.6K Oct 16 14:55 autoptimize_f735042a33273526fb043c5a87f019d8.css.gz
    -rw-r--r-- 1 nginx nginx 151K Oct 16 14:55 autoptimize_single_ced9eb36ba33532225a6f6a5b9c30ac8.css
    -rw-r--r-- 1 nginx nginx  19K Oct 16 14:55 autoptimize_single_ced9eb36ba33532225a6f6a5b9c30ac8.css.br
    -rw-r--r-- 1 nginx nginx  22K Oct 16 14:55 autoptimize_single_ced9eb36ba33532225a6f6a5b9c30ac8.css.gz
    -rw-r--r-- 1 nginx nginx 6.2K Oct 16 14:55 autoptimize_snippet_02186534fc2cb75d30ffeb4e4060f935.css
    -rw-r--r-- 1 nginx nginx 1.1K Oct 16 14:55 autoptimize_snippet_02186534fc2cb75d30ffeb4e4060f935.css.br
    -rw-r--r-- 1 nginx nginx 1.3K Oct 16 14:55 autoptimize_snippet_02186534fc2cb75d30ffeb4e4060f935.css.gz
    -rw-r--r-- 1 nginx nginx  37K Oct 16 14:55 autoptimize_snippet_11ba90148181e3f70031a87c63769326.css
    -rw-r--r-- 1 nginx nginx 4.8K Oct 16 14:55 autoptimize_snippet_11ba90148181e3f70031a87c63769326.css.br
    -rw-r--r-- 1 nginx nginx 5.5K Oct 16 14:55 autoptimize_snippet_11ba90148181e3f70031a87c63769326.css.gz
    -rw-r--r-- 1 nginx nginx  277 Oct 16 14:55 autoptimize_snippet_c623142bb5ed0b70cb3fd1fc009ac97c.css
    -rw-r--r-- 1 nginx nginx  139 Oct 16 14:55 autoptimize_snippet_c623142bb5ed0b70cb3fd1fc009ac97c.css.br
    -rw-r--r-- 1 nginx nginx  203 Oct 16 14:55 autoptimize_snippet_c623142bb5ed0b70cb3fd1fc009ac97c.css.gz
    -rw-r--r-- 1 nginx nginx 5.1K Oct 16 14:55 autoptimize_snippet_c94c9f38516a99b1f2ab4bfb5da9840d.css
    -rw-r--r-- 1 nginx nginx 1.3K Oct 16 14:55 autoptimize_snippet_c94c9f38516a99b1f2ab4bfb5da9840d.css.br
    -rw-r--r-- 1 nginx nginx 1.6K Oct 16 14:55 autoptimize_snippet_c94c9f38516a99b1f2ab4bfb5da9840d.css.gz
    -rw-r--r-- 1 nginx nginx  189 Jun 26 22:11 index.html
    
    wp-content/cache/autoptimize/js:
    total 588K
    drwxr-sr-x 2 nginx nginx 4.0K Oct 16 14:55 .
    drwxr-sr-x 4 nginx nginx 4.0K Oct 16 14:55 ..
    -rw-r--r-- 1 nginx nginx 162K Oct 16 14:55 autoptimize_cffafa51021979d9075b05e79de8dde5.js
    -rw-r--r-- 1 nginx nginx  41K Oct 16 14:55 autoptimize_cffafa51021979d9075b05e79de8dde5.js.br
    -rw-r--r-- 1 nginx nginx  46K Oct 16 14:55 autoptimize_cffafa51021979d9075b05e79de8dde5.js.gz
    -rw-r--r-- 1 nginx nginx  20K Oct 16 14:55 autoptimize_snippet_14b16c0a613dccf79fea485ec09717a1.js
    -rw-r--r-- 1 nginx nginx 6.3K Oct 16 14:55 autoptimize_snippet_14b16c0a613dccf79fea485ec09717a1.js.br
    -rw-r--r-- 1 nginx nginx 7.0K Oct 16 14:55 autoptimize_snippet_14b16c0a613dccf79fea485ec09717a1.js.gz
    -rw-r--r-- 1 nginx nginx  193 Oct 16 14:55 autoptimize_snippet_4ec3b19ffe467100c29c66bcc97ebc42.js
    -rw-r--r-- 1 nginx nginx  136 Oct 16 14:55 autoptimize_snippet_4ec3b19ffe467100c29c66bcc97ebc42.js.br
    -rw-r--r-- 1 nginx nginx  173 Oct 16 14:55 autoptimize_snippet_4ec3b19ffe467100c29c66bcc97ebc42.js.gz
    -rw-r--r-- 1 nginx nginx 1.2K Oct 16 14:55 autoptimize_snippet_4fb38de1728cf7f23aa8b49d85bddde5.js
    -rw-r--r-- 1 nginx nginx  496 Oct 16 14:55 autoptimize_snippet_4fb38de1728cf7f23aa8b49d85bddde5.js.br
    -rw-r--r-- 1 nginx nginx  606 Oct 16 14:55 autoptimize_snippet_4fb38de1728cf7f23aa8b49d85bddde5.js.gz
    -rw-r--r-- 1 nginx nginx 9.9K Oct 16 14:55 autoptimize_snippet_7121994eec5320fbe6586463bf9651c2.js
    -rw-r--r-- 1 nginx nginx 3.5K Oct 16 14:55 autoptimize_snippet_7121994eec5320fbe6586463bf9651c2.js.br
    -rw-r--r-- 1 nginx nginx 4.0K Oct 16 14:55 autoptimize_snippet_7121994eec5320fbe6586463bf9651c2.js.gz
    -rw-r--r-- 1 nginx nginx 1014 Oct 16 14:55 autoptimize_snippet_7567776c328ea6a29916d6cbb521bed6.js
    -rw-r--r-- 1 nginx nginx  398 Oct 16 14:55 autoptimize_snippet_7567776c328ea6a29916d6cbb521bed6.js.br
    -rw-r--r-- 1 nginx nginx  518 Oct 16 14:55 autoptimize_snippet_7567776c328ea6a29916d6cbb521bed6.js.gz
    -rw-r--r-- 1 nginx nginx 121K Oct 16 14:55 autoptimize_snippet_b2d9157ba53608c1226db7a16568b0e8.js
    -rw-r--r-- 1 nginx nginx  29K Oct 16 14:55 autoptimize_snippet_b2d9157ba53608c1226db7a16568b0e8.js.br
    -rw-r--r-- 1 nginx nginx  32K Oct 16 14:55 autoptimize_snippet_b2d9157ba53608c1226db7a16568b0e8.js.gz
    -rw-r--r-- 1 nginx nginx 1.3K Oct 16 14:55 autoptimize_snippet_c2940304f2c898ad4391a9ea96e37e64.js
    -rw-r--r-- 1 nginx nginx  471 Oct 16 14:55 autoptimize_snippet_c2940304f2c898ad4391a9ea96e37e64.js.br
    -rw-r--r-- 1 nginx nginx  561 Oct 16 14:55 autoptimize_snippet_c2940304f2c898ad4391a9ea96e37e64.js.gz
    -rw-r--r-- 1 nginx nginx  197 Oct 16 14:55 autoptimize_snippet_c5935bade23936a28a1b0f0eacd59912.js
    -rw-r--r-- 1 nginx nginx  145 Oct 16 14:55 autoptimize_snippet_c5935bade23936a28a1b0f0eacd59912.js.br
    -rw-r--r-- 1 nginx nginx  176 Oct 16 14:55 autoptimize_snippet_c5935bade23936a28a1b0f0eacd59912.js.gz
    -rw-r--r-- 1 nginx nginx 7.9K Oct 16 14:55 autoptimize_snippet_d0c2c0d7e37652e66657c8c8d6376442.js
    -rw-r--r-- 1 nginx nginx 2.2K Oct 16 14:55 autoptimize_snippet_d0c2c0d7e37652e66657c8c8d6376442.js.br
    -rw-r--r-- 1 nginx nginx 2.5K Oct 16 14:55 autoptimize_snippet_d0c2c0d7e37652e66657c8c8d6376442.js.gz
    -rw-r--r-- 1 nginx nginx  189 Jun 26 22:11 index.html
    
    Then pair Nginx brotli served files with right compiler and cpu i.e. Intel Skylake and Brotli performance acceleration is up to ~40% faster than default Nginx gzip compressed files https://community.centminmod.com/th...r-centmin-mod-nginx-php-fpm.13726/#post-70527 :)

    Just adding that extra brotli PHP extension and being able to properly utilise it on PHP and Nginx level will accelerate Wordpress performance way more than the extra resource usage from loading the brotli PHP extension or all those extra PHP extensions :)

    nginx-h2load-ecdsa256-bit-01.png
    Then zstd PHP extension useful if your PHP web apps use it, I use zstd compression to replace gzip/zlib where possible i.e tar 1.3.1 with native zstd compression support results in much faster tar compressed backup and restore than tar with gzip, bzip2, and xz compression and with right parameters has better compression ratio than gzip = smaller compressed file sizes https://community.centminmod.com/th...with-facebook-zstd-compression-support.16243/ and even can switch nginx and php-fpm log file rotation from gzip to zstd compression for smaller log files. There's work underway for zstd for HTTP encoding/compression (RFC 8478) along with existing gzip and brotli and already work on Nginx zstd bindings too. Eventually, Wordpress Autoptimize plugin could pre-compress gzip, brotli and zstd files and serve them with Nginx gzip, brotli and eventually zstd modules :)
     
    Last edited: Feb 3, 2019
    • Informative! Informative! x 1
    • List
  6. dtdesign

    dtdesign Developer

    568
    287
    +655
    Better late than never, you should tick at least these extensions in order to run our software:
    • dom
    • fileinfo
    • gd
    • json
    • mbstring
    • mcrypt
    • mysqli (not required by us, but since people run other software on the same webspace…)
    • mysqlnd (a bit unclear because this extension sometimes overlaps with the PDO mysql stuff)
    • nd_pdo_mysql (THIS is the non garbage pdo_mysql driver)
    • opcache (optional, because you don't want your page to be slow for no reason, right?)
    • pdo
    • pdo_mysql (DO NOT PICK THIS! Use nd_pdo_mysql instead, because this one is the broken and ancient MySQL PDO lib)
    • sockets
    • xmlwriter
    • xsl
    • zip
    You could also use `imagick`, which offers superior image manipulation features, however, you want to enable it too but not instead of `gd`. The reason is the same as for `mysqli`.

    There are two extensions on the list that you never want to enable:
    • memcache <-- Ancient and broken extension, memcached (notice the trailing `d`) is the actively maintained and working one.
    • suhosin <-- Garbage extension, enable this if you're bored and want to watch your webspace burn to the ground.
     
Verification:
Draft saved Draft deleted
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.