October 27, 2024
Chicago 12, Melborne City, USA
PHP

Docker 'Failed loading Zend extension cannot open shared object file: No such file or directory'


I was working with windows before and the dockerfile below was working fine, now I switched to macos and although I can still run the application without any problems, but I can’t get ioncube to work, I get the following error every time. I have tried and searched a lot of things but I can’t solve it in a very strange way, when I write the relevant directory with cat, the file exists and is there.

PHP Warning:  Failed loading Zend extension 'ioncube' (
tried: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/ioncube
(/usr/local/lib/php/extensions/no-debug-non-zts-20220829/ioncube: cannot open shared object file: No such file or directory),
/usr/local/lib/php/extensions/no-debug-non-zts-20220829/ioncube.so 
(/usr/local/lib/php/extensions/no-debug-non-zts-20220829/ioncube.so: cannot open shared object file: No such file or directory))
in Unknown on line 0
# args
ARG WP_VERSION=6.6
ARG PHP_VERSION=8.2

# Install WordPress with php version
FROM wordpress:${WP_VERSION}-php${PHP_VERSION}-apache

# args
ARG IONCUBE_VERSION=8.2

# Install xdebug
RUN pecl install xdebug && docker-php-ext-enable xdebug

# Install IonCube Loader
RUN cd /usr/local && mkdir -p /ioncube && cd /ioncube && \
    curl -o ioncube.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz && \
    tar xvzf ioncube.tar.gz -C /ioncube --strip-components=1 && rm ioncube.tar.gz && \
    cp ioncube_loader_lin_${IONCUBE_VERSION}.so ioncube.so && mv ioncube.so `php-config --extension-dir` && \
    echo "zend_extension=ioncube" > /usr/local/etc/php/conf.d/docker-php-ext-ioncube.ini

# Download packages
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        curl \
        git \
        unzip \
        libicu-dev \
        libgmp-dev

# Download composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

ENV COMPOSER_ALLOW_SUPERUSER=1
WORKDIR /var/www/html/wp-content/plugins

COPY ./tools ./tools
COPY ./tokenico ./tokenico
COPY ./tokenico-premium ./tokenico-premium

RUN cd ./tools && composer install

# Install LTS Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
    apt-get install -y nodejs

# Install wp-cli
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
    chmod +x wp-cli.phar && \
    mv wp-cli.phar /usr/local/bin/wp
    
RUN mkdir -p /var/www/html/wp-content/uploads
RUN chown -R www-data:www-data /var/www/html/wp-content/uploads

# Apache ServerName
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf

# Port
EXPOSE 80

# Run apache
CMD ["apache2-foreground"]



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video