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

The 5 Most Popular Email APIs Among Developers In 2026

In the modern world, where everything is going digital, email is among the most important means of communication both in personal and business life. As a developer,…

Read More

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

Introduction Construction Management Software (CMS) has become indispensable in 2026 for efficiently handling various aspects of construction projects, ranging from budgeting, scheduling, resource allocation, project tracking, to…

Read More

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

Introduction As the financial services sector continues to evolve, Loan Management Software (LMS) plays a pivotal role in helping businesses streamline their loan operations, from origination to…

Read More

Top 10 AI Presentation Design Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI presentation design tools have become indispensable for professionals, educators, and students aiming to create visually stunning and impactful slide decks with minimal effort….

Read More

Top 10 Web Design Software Tools in 2026: Features, Pros, Cons & Comparison

Introduction Web design software is a vital tool for both professionals and businesses looking to create visually appealing and functional websites. In 2026, with the increase in…

Read More

Top 10 AI Graphic Design Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI graphic design tools have transformed the creative landscape, empowering designers, marketers, and business owners to produce stunning visuals with unprecedented speed and efficiency….

Read More