# No SQL Query information collected from PHP APM agent (WordPress CMS)

**URL:** <https://discuss.elastic.co/t/no-sql-query-information-collected-from-php-apm-agent-wordpress-cms/302208>\
**Category:** APM\
**Tags:** php\
**Created:** [April 12, 2022, 10:06am UTC](https://discuss.elastic.co/t/no-sql-query-information-collected-from-php-apm-agent-wordpress-cms/302208 "2022-04-12T10:06:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![erictung](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erictung/32/109492_2.png) [@erictung](https://discuss.elastic.co/u/erictung)\
**Post date:** [April 12, 2022, 10:06am UTC](https://discuss.elastic.co/t/no-sql-query-information-collected-from-php-apm-agent-wordpress-cms/302208/1 "2022-04-12T10:06:14Z")

</div>

**Kibana version** : 7.13.0

**Elasticsearch version** : 7.13.0

**APM Server version** : 7.13.0

**APM Agent language and version** : PHP 1.5

**Browser version** : Chrome 100

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:

**Fresh install or upgraded from other version?** Fresh install

**Is there anything special in your setup?**  
My current PHP APM configuration:

```auto
elastic_apm.server_url = "http://10.90.24.56:8200"
elastic_apm.secret_token = "REDACTED"
elastic_apm.service_name = "REDACTED"
elastic_apm.environment = "production"

```

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**: Elastic APM agent should be able to collect SQL query made by the application and show it in Kibana, but I'm not sure whether PHP APM agent supports SQL query collection, SQL query simply does not show in each transaction of the PHP application.

**Steps to reproduce** :  
Just follow the steps provided by the Elastic documentation: [Set up the Agent | APM PHP Agent Reference [1.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/php/current/setup.html)

**Errors in browser console (if relevant)**: No

**Provide logs and/or server output (if relevant)**: No

---

<div class="post-metadata">

**Author:** ![erictung](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erictung/32/109492_2.png) [@erictung](https://discuss.elastic.co/u/erictung)\
**Post date:** [April 13, 2022, 8:19am UTC](https://discuss.elastic.co/t/no-sql-query-information-collected-from-php-apm-agent-wordpress-cms/302208/2 "2022-04-13T08:19:31Z")

</div>

Just noticed a GitHub Issues page did mention about this issue:

> <https://github.com/elastic/apm-agent-php/issues/575>
>
> \*\*Is your feature request related to a problem? Please describe.\*\*
> Currently on…ly the PDO extension is supported. This means that queries made with the \[mysqli\](https://www.php.net/manual/en/book.mysqli.php) extension are not being measured.
> 
> \*\*Describe the solution you'd like\*\*
> mysqli queries to be automatically instrumented the same way PDO queries are.
> 
> \*\*Describe alternatives you've considered\*\*
> Manually instrumenting these when queries are called, however this in many projects won't be feasible as these calls are made by a library rather than the application itself.
> 
> \*\*Additional context\*\*
> WordPress is the most used PHP application, which exclusively uses mysqli. Without support for mysqli a majority of PHP applications won't have any automatic instrumentation for database queries.

So this means WordPress is simply not supported due to the use of MySQLi extension in the application. Hopefully this PHP APM agent can consider supporting MySQLI extension in the future.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 4, 2022, 4:19am UTC](https://discuss.elastic.co/t/no-sql-query-information-collected-from-php-apm-agent-wordpress-cms/302208/3 "2022-05-04T04:19:38Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
