elastic / elastic/apm-agent-php

Document limitation of upgrading PHP after agent is installed

Open
#674 1 comment 0 reactions 0 assignees View on GitHub
8.12-candidate agent-php PHP specific technology priority: low triaged
Dominant language
PHP
Stars
268
Forks
86
PR merge metrics
No merged PRs in 30d

Description

There is an issue that comes when PHP is upgraded after the agent is installed. It causes PHP to print error messages similar to the following
```
$ php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/elastic/apm-agent-php/extensions/elastic_apm-20180731.so' (tried: /opt/elastic/apm-agent-php/extensions/elastic_apm-20180731.so (/opt/elastic/apm-agent-php/extensions/elastic_apm-20180731.so: undefined symbol: php_sprintf), /usr/lib64/php/modules//opt/elastic/apm-agent-php/extensions/elastic_apm-20180731.so.so (/usr/lib64/php/modules//opt/elastic/apm-agent-php/extensions/elastic_apm-20180731.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.4.28 (cli) (built: Feb 15 2022 13:23:10) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies**_
```

The root cause is the PHP agent's extension .so file is per PHP version so when PHP gets upgraded but PHP agent's .ini file still points to the same .so file which is now incompatible with the new PHP version.

It seems the simplest workaround recommendation is to just uninstall and install the agent again (which will automatically select correct .so file)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.