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

Terraform Backend Tutorial

Terraform is a popular open-source infrastructure as code tool used to create and manage infrastructure resources. The state of the infrastructure resources managed by Terraform is stored…

Read More

Best Tools for Software Composition Analysis (SCA)

Here’s a clear and professional explanation of the three related concepts you asked about — all of which are critical parts of secure software development, especially in…

Read More

Top 10 AI Code Review Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI code review tools have become essential for developers aiming to enhance code quality, streamline workflows, and accelerate software delivery. These tools leverage advanced…

Read More

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

Introduction Expense management tools are critical for businesses of all sizes in 2026 as they help streamline financial processes, improve budgeting, ensure compliance, and enhance financial visibility….

Read More

Top 10 Web Application Firewall (WAF) Tools in 2026: Features, Pros, Cons & Comparison

Introduction In the rapidly evolving landscape of cybersecurity, Web Application Firewalls (WAFs) have become a critical component in defending web applications from malicious attacks such as SQL…

Read More

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

Introduction In 2026, businesses of all sizes are increasingly reliant on a variety of devices—laptops, desktops, mobile devices, and other endpoints—that connect to their networks. With the…

Read More