Introduction
This guide will contain details about how to install the pecl "datadog" module. The updated version of this module requires a newer version of GCC than the version available below Centos 8.
Attempting to install the latest version of Centos 7 will fail with a similar error like the below.
/root/tmp/pear/datadog_trace/ext/php7/ddtrace.c:15:23:
fatal error: stdatomic.h: No such file or directory
#include <stdatomic.h>
^
compilation terminated.
make: *** [ext/php7/ddtrace.lo] Error 1
ERROR: `make' failed
This is due to requiring a newer version of GCC.
Procedure
* On Centos 7, you will need to install version 0.50.0. Pecl allows you to specify which version of the module to install if multiple versions are available. This is very useful when the latest module isn't supported on the current operating system.
1. First install curl-devel as this is required.
/usr/bin/yum install -y libcurl-devel
2. Run the pecl install command.
/usr/bin/scl enable ea-phpxx 'pecl install datadog_trace-0.50.0'
or
/usr/bin/ea-phpxx-pecl install datadog_trace-0.50.0
Note: Replace "xx" with the PHP version number, for example, "73" or "74".
/usr/bin/ea-php74-pecl install datadog_trace-0.50.0
3. Verify the installation completed.
/usr/bin/ea-php74 -i |grep ^dd
ddtrace
ddtrace.disable => Off => Off
ddtrace.request_init_hook => /opt/cpanel/ea-php74/root/usr/share/pear/
datadog_trace/bridge/dd_wrap_autoloader.php => /opt/cpanel/ea-php74/
root/usr/share/pear/datadog_trace/bridge/dd_wrap_autoloader.php
* On Centos 8 servers, install the latest version normally.
1. First install curl-devel as this is required.
/usr/bin/yum install -y libcurl-devel
2. Install the module normally without specifying the version.
/usr/bin/scl enable ea-phpxx 'pecl install datadog_trace
or
/usr/bin/ea-phpxx-pecl install datadog_trace
Note: Replace "xx" with the PHP version number, for example, "73" or "74".
/usr/bin/ea-php74-pecl install datadog_trace
3. Verify the installation completed.
/usr/bin/ea-php74 -i |grep ^dd
ddtrace
ddtrace.disable => Off => Off
ddtrace.request_init_hook => /opt/cpanel/ea-php74/root/usr/share/pear/
datadog_trace/bridge/dd_wrap_autoloader.php => /opt/cpanel/ea-php74/
root/usr/share/pear/datadog_trace/bridge/dd_wrap_autoloader.php