Discover Centmin Mod today
Register Now

PHP-FPM pthreads how to

Discussion in 'Centmin Mod Insights' started by upgrade81, Aug 12, 2020.

  1. upgrade81

    upgrade81 Premium Member Premium Member

    266
    16
    18
    Sep 5, 2016
    Italy
    Ratings:
    +27
    Local Time:
    7:23 PM
    1.17
    10.3
    Excuse me could you tell me how to recompile php 7.4 by enabling pthreads?
    exactly the software requires: --enable-pthreads --with-tsrm-pthreads --enable-maintainer-zts "

    ZTS I have already enabled it from custom_config


    thank you very much
     
  2. upgrade81

    upgrade81 Premium Member Premium Member

    266
    16
    18
    Sep 5, 2016
    Italy
    Ratings:
    +27
    Local Time:
    7:23 PM
    1.17
    10.3
    it is also fine on the 7.3, if possible.
     
  3. eva2000

    eva2000 Administrator Staff Member

    45,192
    10,277
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,927
    Local Time:
    3:23 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    depends on the options if they don't need dependencies installed PHP: Installation - Manual, the same way outlined at PHP-FPM - Insight Guide - How to install pthreads PECL Extension for PHP CLI Only ? should work

    in /etc/centminmod/custom_config.inc set
    Code (Text):
    PHP_EXTRAOPTS=" --with-xsl --with-tsrm-pthread --enable-maintainer-zts"
    

    enable-pthreads isn't needed as pthreads is meant to be loaded as an extension in step 2 at PHP-FPM - Insight Guide - How to install pthreads PECL Extension for PHP CLI Only ?

    but not 100% as never used pthreads in production

    what web app requires PHP in ZTS mode ?

    remember all steps in PHP-FPM - Insight Guide - How to install pthreads PECL Extension for PHP CLI Only ? need to be done
     
  4. upgrade81

    upgrade81 Premium Member Premium Member

    266
    16
    18
    Sep 5, 2016
    Italy
    Ratings:
    +27
    Local Time:
    7:23 PM
    1.17
    10.3
    Thank you very much I will follow the steps.

    is software that is meant to send push notifications (as or better than onesignal).
     
  5. eva2000

    eva2000 Administrator Staff Member

    45,192
    10,277
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,927
    Local Time:
    3:23 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    note also pthreads extension hasn't been updated since Dec 2018
     
  6. eva2000

    eva2000 Administrator Staff Member

    45,192
    10,277
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,927
    Local Time:
    3:23 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
  7. upgrade81

    upgrade81 Premium Member Premium Member

    266
    16
    18
    Sep 5, 2016
    Italy
    Ratings:
    +27
    Local Time:
    7:23 PM
    1.17
    10.3
    Yes, I saw.
    Actually the software does not support php 7.4 but only 7.3 max.
     
  8. eva2000

    eva2000 Administrator Staff Member

    45,192
    10,277
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,927
    Local Time:
    3:23 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    technically you only need --enable-maintainer-zts and not --with-tsrm-pthreads

    with
    Code (Text):
    PHP_EXTRAOPTS=" --with-xsl --enable-maintainer-zts"

    results in ZTS based PHP 7.3.21
    Code (Text):
    php -v
    PHP 7.3.21 (cli) (built: Aug 12 2020 22:12:05) ( ZTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.3.21, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.3.21, Copyright (c) 1999-2018, by Zend Technologies
    

    Code (Text):
    php -r "print_r(class_exists('Thread'));"
    1
    
    php -r "echo PHP_ZTS;"                   
    1
    

    pthread extension loaded via step 2 in link at PHP-FPM - Insight Guide - How to install pthreads PECL Extension for PHP CLI Only ?
    Code (Text):
    php -m
    [PHP Modules]
    bcmath
    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
    maxminddb
    mbstring
    mcrypt
    memcache
    memcached
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    posix
    pspell
    pthreads
    readline
    redis
    Reflection
    session
    shmop
    SimpleXML
    snmp
    soap
    sockets
    sodium
    SPL
    sqlite3
    standard
    sysvmsg
    sysvsem
    sysvshm
    tidy
    timezonedb
    tokenizer
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    Zend OPcache
    zip
    zlib
    [Zend Modules]
    Zend OPcache
    

    step 3 created php-cli.ini config file being used (Loaded Configuration File)
    Code (Text):
    php --ini
    Configuration File (php.ini) Path: /usr/local/lib
    Loaded Configuration File:         /usr/local/lib/php-cli.ini
    Scan for additional .ini files in: /etc/centminmod/php.d
    Additional .ini files parsed:      /etc/centminmod/php.d/a_customphp.ini,
    /etc/centminmod/php.d/curlcainfo.ini,
    /etc/centminmod/php.d/geoip.ini,
    /etc/centminmod/php.d/igbinary.ini,
    /etc/centminmod/php.d/imagick.ini,
    /etc/centminmod/php.d/mailparse.ini,
    /etc/centminmod/php.d/maxminddb.ini,
    /etc/centminmod/php.d/mcrypt.ini,
    /etc/centminmod/php.d/memcache.ini,
    /etc/centminmod/php.d/memcached.ini,
    /etc/centminmod/php.d/mysqlnd.ini,
    /etc/centminmod/php.d/preload.ini,
    /etc/centminmod/php.d/redis.ini,
    /etc/centminmod/php.d/timezonedb.ini,
    /etc/centminmod/php.d/zendopcache.ini,
    /etc/centminmod/php.d/zz-zendopcache.ini,
    /etc/centminmod/php.d/zzz-mailxheader.ini
    
     
  9. upgrade81

    upgrade81 Premium Member Premium Member

    266
    16
    18
    Sep 5, 2016
    Italy
    Ratings:
    +27
    Local Time:
    7:23 PM
    1.17
    10.3
    this is exactly how I compiled it now.

    I'm missing the steps to add the extension, so ... correct?
     
  10. eva2000

    eva2000 Administrator Staff Member

    45,192
    10,277
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,927
    Local Time:
    3:23 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
  11. upgrade81

    upgrade81 Premium Member Premium Member

    266
    16
    18
    Sep 5, 2016
    Italy
    Ratings:
    +27
    Local Time:
    7:23 PM
    1.17
    10.3
    You are a dragon!

    Really nice, I try it all later.
    If you need software to send push notifications, feel free to ask me without problems.