phpdockerfilexml-rpcphp-8php-8.1

Install XML-RPC in PHP8 Dockerfile


I have this Dockerfile:

FROM php:8.1.0-fpm

RUN apt-get update \
    && apt-get install -y zlib1g-dev g++ git libicu-dev zip libzip-dev zip libpng-dev libssl-dev libxslt-dev wkhtmltopdf procps acl \
    && pecl install apcu \
    && docker-php-ext-install intl opcache pdo pdo_mysql zip gd xsl -j$(nproc) \
    && docker-php-ext-enable apcu opcache \
    && docker-php-ext-configure zip

# xmlrpc
# channel://pecl.php.net/xmlrpc-1.0.0RC3
# php-xmlrpc
# php-xml-rpc
# php8.1-xmlrpc
# php-pecl-xmlrpc
# php81-pecl-xmlrpc
# xmlrpc-1.0.0RC3

I've tried so many ways to include XML-RPC in there (c.f. commented lines) but nothing's working. I know it's not recommended to use this package but it's a dependency that I absolutely need. It worked fine in PHP 7.4, but I can't figure it out for PHP 8.1.

Can anyone clue me in please?


Solution

  • Add this command

    RUN pecl install channel://pecl.php.net/xmlrpc-1.0.0RC3  xmlrpc
    

    and do not forget to add "extension=xmlrpc.so" to php.ini file.