Skip to main content

Install custom PHP extension in PHP 7.3

Comments

3 comments

  • dalem
    EA4 is RPM based you have to build an RPM for it
    0
  • monkey64
    EA4 is RPM based but I have other custom PHP ".so" extensions which work in this way. For example, I have a memcached.so module which is installed in "/opt/cpanel/ea-php72/root/usr/lib64/php/modules". I can prove it works by viewing phpinfo(). I can see "Memcached" show up in the info returned by the function. If I remove the memcached.so module and restart PHP, the Memcached section disappears. @dalem: You say "you have to build an RPM for it" but how come my other extensions work?
    0
  • cPanelLauren
    You're installing the module but are you inititalizing it? You would need to add a file at: /opt/cpanel/ea-php72/root/etc/php.d
    in the format of (we'll use mbstring as an example): cat 20-mbstring.ini ; Enable mbstring extension module extension=mbstring.so
    I can prove it works by viewing phpinfo(). I can see "Memcached" show up in the info returned by the function. If I remove the memcached.so module and restart PHP, the Memcached section disappears.

    Are you using your own version of this or the cPanel provided version available in the experimental repository? When installed using the experimental repository it is placed in the following: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/memcached.so
    /opt/cpanel/ea-php72/root/etc/php.d/memcached.ini
    Now, I don't know if there is any further configuration required for the extension you're installing, which could make a difference and I'd note @ashirjaan's instructions in that case but ultimately the right way to do this is to add the include in the correct directory rather than modify the .ini file directly
    0

Please sign in to leave a comment.