My goal is to run AppDynamics in the context of a PHP application using an Alpine container. I am using the official image php:8.2-fpm-alpine which can be seen here
On the appdynamics side, I am using the archive above which was the latest to be found in the download area
appdynamics-php-agent-x64-linux-24.11.0.1340.tar.bz2
I was able to successfully install the PHP agent thanks to the install script from the archive
appdynamics-php-agent-linux_x64/install.sh
However, when running command "php -m", I get this message
Warning: PHP Startup: Unable to load dynamic library 'appdynamics_agent.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/appdynamics_agent.so (Error loading shared library libstdc++.so.6: No such file or directory (needed by /usr/local/lib/php/extensions/no-debug-non-zts-20220829/appdynamics_agent.so)), /usr/local/lib/php/extensions/no-debug-non-zts-20220829/appdynamics_agent.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20220829/appdynamics_agent.so.so: No such file or directory)) in Unknown on line 0
I tried various ways to install but then run into other problems
RUN apk add --no-cache \
gcompat \
libstdc++
Which leads to
Warning: PHP Startup: Unable to load dynamic library 'appdynamics_agent.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/appdynamics_agent.so (Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20220829/appdynamics_agent.so: __vsnprintf_chk: symbol not found), /usr/local/lib/php/extensions/no-debug-non-zts-20220829/appdynamics_agent.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20220829/appdynamics_agent.so.so: No such file or directory)) in Unknown on line 0
What could be wrong? I don't see much help in the documentation regarding appdynamic in the context of an alpine container.
You most likely didn't install the full glibc package or needed libraries with those 2 commands
We used it for something else(Not AppDynamics) on alpine before and worked great
https://github.com/sgerrand/alpine-pkg-glibc
i will try the solution as well shortly from my side but should resolve the issue with
Hi Morelz,
Thanks for digging
Actually I already tried the suggested approach but got the same result / error. I double checked that and can confirm (the error). You can see the change I made
https://github.com/fabarea/appdynamics-php-alpine-example/pull/1
Also if that is the way to go, the docs must be updated as it is stated to go with version >= 2.5 - and here we deal with an inferior version (2.35)
> "Any Linux distribution based on glibc 2.5+ and the x86 32-bit or x86 64-bit architecture"
Link to the docs:
Hi Morelz,
Any news / progress on this?
Hi Have you set the permissions? How is your php application configured, does it run under a specific user/group? Please ensure to set the permissions recursively to allow the php user to access the Appdynamics php agent directory and the copied files within the php directory
I have made a demo Dockerfile to reproduce the problem
https://github.com/fabarea/appdynamics-php-alpine-example.git
Notice: I have not included the appdynamics php agent file in the repo (appdynamics-php-agent-x64-linux-24.11.0.1340.tar.bz2). I am not sure it is allowed. It can be downloaded from appdynamics however
To answer your questions:
The container is run as root for now, so there is no permission issue. I am limiting the example to the PHP CLI for now.