Splunk AppDynamics

Install AppDynamics in the context of an alpine container for a PHP application

fab1en
Observer

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

https://hub.docker.com/layers/library/php/8.2-fpm-alpine/images/sha256-fbe14883e5e295fb5ce3b28376faf...

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.

Labels (1)
Tags (3)
0 Karma

Morelz
Motivator

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 

0 Karma

fab1en
Observer

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:

https://docs.appdynamics.com/appd/21.x/21.1/en/application-monitoring/install-app-server-agents/php-...

0 Karma

fab1en
Observer

Hi Morelz,

Any news / progress on this?

0 Karma

Morelz
Motivator

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

fab1en
Observer

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.

 

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...