Want to subscribe to topics you're interested in?
Become a Member

PHP-FPM Install PHP 8.1 Event extension?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by rdan, Jun 10, 2022.

  1. rdan

    rdan Well-Known Member

    5,371
    1,353
    113
    May 25, 2014
    Ratings:
    +2,112
    Local Time:
    11:28 AM
    Mainline
    10.2
    Workerman


    Require and recommend:
    How to properly install Event extension on CMM?
    Thanks!
     
  2. eva2000

    eva2000 Administrator Staff Member

    49,594
    11,387
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,692
    Local Time:
    1:28 PM
    Nginx 1.21.x
    MariaDB 10.x
    From
    Code (Text):
    # change into /svr-setup directory via pushd
    pushd /svr-setup
    wget https://pecl.php.net/get/event-3.0.8.tgz -O event-3.0.8.tgz
    tar xvzf event-3.0.8.tgz
    cd event-3.0.8
    make clean
    # generic install instructions in INSTALL.md
    # modify for Centmin Mod phpize and php-config paths
    /usr/local/bin/phpize
    ./configure --with-php-config=/usr/local/bin/php-config --with-event-core --with-event-extra --enable-event-debug --with-event-libevent-dir=/usr/lib64
    make -j$(nproc)
    make install
    echo 'extension=event.so' > /etc/centminmod/php.d/event.ini
    fpmrestart
    php --ri event
    # use popd to return to directory prior to initial pushed /svr-setup
    popd
    

    Code (Text):
    php --ri event
    
    event
    
    Event support => enabled
    Sockets support => enabled
    Debug support => enabled
    Extra functionality support including HTTP, DNS, and RPC => enabled
    OpenSSL support => enabled
    Thread safety support => disabled
    Extension version => 3.0.8
    libevent2 headers version => 2.0.21-stable
    
     
    Last edited: Jun 19, 2022
  3. eva2000

    eva2000 Administrator Staff Member

    49,594
    11,387
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,692
    Local Time:
    1:28 PM
    Nginx 1.21.x
    MariaDB 10.x
  4. rdan

    rdan Well-Known Member

    5,371
    1,353
    113
    May 25, 2014
    Ratings:
    +2,112
    Local Time:
    11:28 AM
    Mainline
    10.2
    Could be possible to add on CMM as optional extension?
    Disabled by default :).
     
  5. eva2000

    eva2000 Administrator Staff Member

    49,594
    11,387
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,692
    Local Time:
    1:28 PM
    Nginx 1.21.x
    MariaDB 10.x
  6. eva2000

    eva2000 Administrator Staff Member

    49,594
    11,387
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,692
    Local Time:
    1:28 PM
    Nginx 1.21.x
    MariaDB 10.x
    FYI, updated above event configure options from
    Code (Text):
    ./configure --with-php-config=/usr/local/bin/php-config --with-event-core --with-event-extra --enable-event-debug
    

    to
    Code (Text):
    ./configure --with-php-config=/usr/local/bin/php-config --with-event-core --with-event-extra --enable-event-debug --with-event-libevent-dir=/usr/lib64
    

    so to pickup Centmin Mod's libevent library 2.1.x instead of YUM system libevent 2.0.x library
    Code (Text):
    php --ri event
    
    event
    
    Event support => enabled
    Sockets support => enabled
    Debug support => enabled
    Extra functionality support including HTTP, DNS, and RPC => enabled
    OpenSSL support => enabled
    Thread safety support => disabled
    Extension version => 3.0.8
    libevent2 headers version => 2.1.12-stable
    
     
  7. rdan

    rdan Well-Known Member

    5,371
    1,353
    113
    May 25, 2014
    Ratings:
    +2,112
    Local Time:
    11:28 AM
    Mainline
    10.2
    But I do not install memcached, so this library isn't installed by default also?
     
  8. rdan

    rdan Well-Known Member

    5,371
    1,353
    113
    May 25, 2014
    Ratings:
    +2,112
    Local Time:
    11:28 AM
    Mainline
    10.2
    Thanks a lot Eva

    upload_2022-6-10_21-56-20.png
     
  9. rdan

    rdan Well-Known Member

    5,371
    1,353
    113
    May 25, 2014
    Ratings:
    +2,112
    Local Time:
    11:28 AM
    Mainline
    10.2
    How to properly update this also?
    libevent2 headers version 2.1.8-stable
     
  10. rdan

    rdan Well-Known Member

    5,371
    1,353
    113
    May 25, 2014
    Ratings:
    +2,112
    Local Time:
    11:28 AM
    Mainline
    10.2
    I can safely omit this command right?
    To have Debug support disabled.
     
  11. rdan

    rdan Well-Known Member

    5,371
    1,353
    113
    May 25, 2014
    Ratings:
    +2,112
    Local Time:
    11:28 AM
    Mainline
    10.2
    I'm using the stable version so can't use this :-(

    What I did was:
    Create the file at:
    /root/tools/run-after-php-upgrade.sh
    Run manually.

    Maybe in the future :)
    But it's great to have and lower down CPU usage a lot when using websocket apps.
    Added event extension 10:26
    Restarted socket server 10:34

    upload_2022-6-10_22-46-36.png

    upload_2022-6-10_23-57-58.png
     
    Last edited: Jun 11, 2022
  12. eva2000

    eva2000 Administrator Staff Member

    49,594
    11,387
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,692
    Local Time:
    1:28 PM
    Nginx 1.21.x
    MariaDB 10.x
    From https://community.centminmod.com/threads/install-php-8-1-event-extension.22911/#post-93413 and in persistent config file set LIBEVENT_VERSION='2.1.12
    Yeah though the installation instructions list it
    124.00stable only gets bug or security fixes and rarely new features now. New features land in 130.00beta01 right now, so even if I do add event PHP by default, it will be in 130.00beta01 only as well.
     
  13. rdan

    rdan Well-Known Member

    5,371
    1,353
    113
    May 25, 2014
    Ratings:
    +2,112
    Local Time:
    11:28 AM
    Mainline
    10.2
    After that, run menu #5 to recompile PHP?
     
  14. eva2000

    eva2000 Administrator Staff Member

    49,594
    11,387
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,692
    Local Time:
    1:28 PM
    Nginx 1.21.x
    MariaDB 10.x
  15. eva2000

    eva2000 Administrator Staff Member

    49,594
    11,387
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,692
    Local Time:
    1:28 PM
    Nginx 1.21.x
    MariaDB 10.x
  16. rdan

    rdan Well-Known Member

    5,371
    1,353
    113
    May 25, 2014
    Ratings:
    +2,112
    Local Time:
    11:28 AM
    Mainline
    10.2
    Thank you so much Eva.