We had a need to integrate APM to php project. I have tried many ways and debug a lot but couldn’t get success.
My system using docker and container to setup a php, nginx server. We are using php 8.2, ubuntu 22.04 and required libraries.
We have added below solutions into my docker file.
So there are three ways we can integrate as I know.
- Using directly Debian (.deb) package.
dpkg -i <package-file>.deb
Error : PHP Startup: Unable to load dynamic library ‘/opt/elastic/apm-agent-php/
- Using git and phpize.
- RUN apt install -y php-dev
RUN mkdir -p /home/apm-agent && \
cd /home/apm-agent && \
git clone https://github.com/elastic/
ls -la apm && ls -la apm/agent/native/ext && \
cd apm/agent/native/ext && \
phpize && ./configure –enable-elastic_apm && \
make clean && make && make install
RUN COPY ./elastic_apm.ini /etc/php/8.2/cli/conf.d/
Error : No rule to make target ‘/home/apm-agent/apm/agent/
- Using git and make, docker way
- RUN curl -L “https://github.com/elastic/
apm-agent-php/archive/refs/ tags/v1.10.0.tar.gz” | tar -C /tmp -zx && \ - cd /tmp/apm-agent-php-*/ && ls -la && export BUILD_ARCHITECTURE=linux-x86-
64 && make -f .ci/Makefile build
- RUN curl -L “https://github.com/elastic/
Error :/bin/bash: line 1: docker: command not found,
Solution : Install docker but couldn’t get success
Conclusion : couldn’t get success.
A Failure …