we are trying to install XDebug inside a Docker container based on Alpine Linux and running php-fpm. We followed the installation instructions given at this page. It says to run following for Alpine Linux which is what we did:
bash-5.0# apk add php7-pecl-xdebug
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
(1/2) Installing php7-common (7.3.22-r0)
(2/2) Installing php7-pecl-xdebug (2.9.1-r0)
OK: 85 MiB in 74 packages
we could then see the .so
file is under /usr/lib/php7/modules/xdebug.so
and so we added it to our /usr/local/etc/php/php.ini
like so:
zend_extension = /usr/lib/php7/modules/xdebug.so
Then we restarted the container. The webpage says to verify the installation by running:
bash-5.0# php -v
when we run the command this is the output we get:
bash-5.0# php -v
Failed loading /usr/lib/php7/modules/xdebug.so: Error relocating /usr/lib/php7/modules/xdebug.so: php_sprintf: symbol not found
PHP 7.4.4 (cli) (built: Mar 24 2020 01:34:16) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.4, Copyright (c), by Zend Technologies
How can we fix this? Thanks. In case it helps:
bash-5.0# ls -al /usr/lib/php7/modules/xdebug.so
-rwxr-xr-x 1 root root 268088 Jan 18 2020 /usr/lib/php7/modules/xdebug.so