codecasts / php-alpine

PHP APK Repository for Alpine Linux
https://github.com/codecasts/php-alpine
483 stars 58 forks source link

Unsupported extensions not loaded for PHP 7.3 (unable to load dynamic library) #60

Closed thomas-hiron closed 5 years ago

thomas-hiron commented 5 years ago

Hi!

I have a problem similar to issue #28, I can't load unsupported extensions (xmlwriter, simplexml, fileinfo, tokenizer).

Here is my Dockerfile:

FROM alpine:3.8

# Add php 7.3 repo from codecasts: https://github.com/codecasts/php-alpine
ADD https://php.codecasts.rocks/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
RUN apk --update add ca-certificates
RUN echo "@php https://php.codecasts.rocks/v3.8/php-7.3" >> /etc/apk/repositories

RUN apk update && apk add --no-cache --update \
            php-fpm@php \
            php-bcmath@php \
            php-mbstring@php \
            php-gd@php \
            php-iconv@php \
            php-intl@php \
            php-pdo@php \
            php-pdo_mysql@php \
            php-soap@php \
            php-xsl@php \
            php-xml@php \
            php-opcache@php \
            php-json@php \
            php-phar@php \
            php-session@php \
            php-curl@php \
            php7-xmlwriter \
            php7-simplexml \
            php7-fileinfo \
            php7-tokenizer \
            curl \
            bash \
        && rm -rf /var/cache/apk/*

RUN ln -s /usr/bin/php7 /usr/bin/php

And here is the result of php -v:

PHP Warning:  PHP Startup: Unable to load dynamic library 'fileinfo.so' (tried: /usr/lib/php7/modules/fileinfo.so (Error relocating /usr/lib/php7/modules/fileinfo.so: _zval_ptr_dtor: symbol not found), /usr/lib/php7/modules/fileinfo.so.so (Error loading shared library /usr/lib/php7/modules/fileinfo.so.so: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'simplexml.so' (tried: /usr/lib/php7/modules/simplexml.so (Error relocating /usr/lib/php7/modules/simplexml.so: _zval_get_string_func: symbol not found), /usr/lib/php7/modules/simplexml.so.so (Error loading shared library /usr/lib/php7/modules/simplexml.so.so: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'tokenizer.so' (tried: /usr/lib/php7/modules/tokenizer.so (Error relocating /usr/lib/php7/modules/tokenizer.so: _zval_ptr_dtor: symbol not found), /usr/lib/php7/modules/tokenizer.so.so (Error loading shared library /usr/lib/php7/modules/tokenizer.so.so: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'xmlwriter.so' (tried: /usr/lib/php7/modules/xmlwriter.so (Error relocating /usr/lib/php7/modules/xmlwriter.so: zend_get_std_object_handlers: symbol not found), /usr/lib/php7/modules/xmlwriter.so.so (Error loading shared library /usr/lib/php7/modules/xmlwriter.so.so: No such file or directory)) in Unknown on line 0
PHP 7.3.0 (cli) (built: Dec 11 2018 22:55:24) ( NTS )

What can be the problem? Thanks!

hernandev commented 5 years ago
            php7-xmlwriter \
            php7-simplexml \
            php7-fileinfo \
            php7-tokenizer \

you forgot the @php on those, but you don't actually need cause they are bundle on core php build.

some of thoses like tokenizer are already bundled into php core ext, no need to install.

the ones you can't find on @php are most likelly to be bundled.

you can also check the directory listing to see the extensions available there.

Thanks

thomas-hiron commented 5 years ago

What do you mean by the ones who need to be bundled?
How is this related to the warning messages?

temp commented 5 years ago

@thomas-hiron When you look at the output of the apk add, you will probably notice that these 4 packages are not installed from codecasts, but from the main alpine repository, in version 7.2.x. Simply remove these 4 lines from your Dockerfile and it will work. These extension are already available, they are part of php7-fpm@php (fpm) and php7@php (cli).

thomas-hiron commented 5 years ago

I will try that and close if solved! Thank you

glensc commented 5 years ago

close if solved then