Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

How to install & Configure Datadog APM with PHP based application (WordPress) in linux?

Prerequisite

Step 1- Install DD Agent and Start it

Step 2- Choose your language- Offcourse PHP

Step 3- Install the PHP client for APM datadog tracing

Reference:
- https://github.com/DataDog/dd-trace-php/releases

$ cd /opt
$ wget https://github.com/DataDog/dd-trace-php/releases/download/0.53.0/datadog-php-tracer-0.53.0-1.x86_64.rpm
$ rpm -ivh datadog-php-tracer-0.53.0-1.x86_64.rpmCode language: JavaScript (javascript)

Step 4 – Make sure following Spec to avoid an ERROR

$ vi /opt/lampp/etc/php.ini
extension=/opt/datadog-php/extensions/ddtrace-.so - WRONG

$ more /opt/lampp/logs/php_error_log

# Take latest version of ddtrace using "ls /opt/datadog-php/extensions/"
$ vi /opt/lampp/etc/php.ini
extension=/opt/datadog-php/extensions/ddtrace-20200930.so - RIGHT

$ /opt/lampp/lampp restartCode language: PHP (php)

Step 5 – Validate ddtrace is enabled or not

$ export PATH=$PATH:/opt/lampp/bin/
$ php --version
$ php -m | grep ddtrace
Code language: JavaScript (javascript)

Step 4 – Modify Apache Configuration to set Datadog APM Meta data for a application

vi /opt/lampp/etc/httpd.conf

SetEnv DD_SERVICE 'wordpress'
SetEnv DD_ENV 'dev'
SetEnv DD_VERSION 'latest'
SetEnv DD_TRACE_SAMPLE_RATE '1'
SetEnv DD_TRACE_DEBUG true

$ /opt/lampp/lampp restartCode language: JavaScript (javascript)

Step 5 – Create a load on http://13.233.196.197/wordpress/ using Jmeter

$ netstat -tulpn | grep LISTEN
$ curl http://127.0.0.1:8126
$ datadog-agent config | head -n 35

By default the Datadog Agent is enabled in your datadog.yaml file under apm_enabled: true and listens for trace traffic at localhost:8126Code language: JavaScript (javascript)

Error & Solution – 1

[root@ip-172-31-25-121 opt]# rpm -ivh datadog-php-tracer-0.53.0-1.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:datadog-php-tracer-0.53.0-1      ################################# [100%]
### PHP version
/var/tmp/rpm-tmp.hSDzSh: line 34: -d: command not found
### Installing Datadog PHP tracing extension (ddtrace)
###
### Logging  -i to a file
###
/var/tmp/rpm-tmp.hSDzSh: line 34: -d: command not found
/var/tmp/rpm-tmp.hSDzSh: line 34: -d: command not found
/var/tmp/rpm-tmp.hSDzSh: line 34: -d: command not found
/var/tmp/rpm-tmp.hSDzSh: line 34: -d: command not found
/var/tmp/rpm-tmp.hSDzSh: line 34: -d: command not found
/var/tmp/rpm-tmp.hSDzSh: line 34: -d: command not found
/var/tmp/rpm-tmp.hSDzSh: line 34: -d: command not found
###
### conf.d folder not found falling back to appending extension config to main "php.ini"
/var/tmp/rpm-tmp.hSDzSh: line 34: -d: command not found
### Failed enabling ddtrace extension
###
### The extension has been installed but couldn't be enabled
### Try adding the extension manually to your PHP - php.ini - configuration file
### e.g. by adding following line:
###
###     extension=/opt/datadog-php/extensions/ddtrace-.so
###
### Note that your PHP API version must match the extension's API version
### PHP API version can be found using following command
###
###      -i | grep 'PHP API'
###
[root@ip-172-31-25-121 opt]# php
bash: php: command not found

SOLUTION
--------------
rpm -e datadog-php-tracer-0.53.0-1.x86_64
rm -rf datadog-php
export PATH=$PATH:/opt/lampp/bin/
php --version

extension=/opt/datadog-php/extensions/ddtrace-.so

===========================================
DD_TRACE_CLI_ENABLED=true DD_SERVICE='test' DD_ENV='dev' DD_VERSION='1' DD_TRACE_SAMPLE_RATE='1' php -r 'echo "Hello PHP";'Code language: PHP (php)

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Top 10 Subscription Management Software Tools in 2026: Features, Pros, Cons & Comparison

Introduction Subscription management software is designed to streamline and optimize the process of managing recurring billing, customer subscriptions, and related business operations. In 2026, with the rapid…

Read More

Top 10 AI Data Integration Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI data integration tools are pivotal for businesses navigating the complexities of modern data ecosystems. These tools combine artificial intelligence with data integration processes…

Read More

Top 10 Fleet Management Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, the logistics and transportation industries are evolving rapidly, and managing a fleet of vehicles has never been more complex. Fleet management software has become…

Read More

Top 10 AI Academic Plagiarism Checkers Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI academic plagiarism checkers have become indispensable tools for students, educators, researchers, and institutions striving to uphold academic integrity. With the rise of AI-generated…

Read More

Top 10 Travel Management Software Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, travel management software (TMS) has become a crucial tool for businesses, travel agencies, and frequent travelers. These tools automate the booking, tracking, and management…

Read More

Top 10 No-Code Platforms Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, no-code platforms have become essential for businesses and individuals looking to build powerful applications, websites, and automations without the need for programming knowledge. These…

Read More