# How to use php agent with php

**URL:** <https://discuss.elastic.co/t/how-to-use-php-agent-with-php/370625>\
**Category:** APM\
**Tags:** php\
**Created:** [November 15, 2024, 7:08pm UTC](https://discuss.elastic.co/t/how-to-use-php-agent-with-php/370625 "2024-11-15T19:08:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anubhav\_Jha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anubhav_jha/32/137617_2.png) [@Anubhav\_Jha](https://discuss.elastic.co/u/Anubhav_Jha)\
**Post date:** [November 15, 2024, 7:08pm UTC](https://discuss.elastic.co/t/how-to-use-php-agent-with-php/370625/1 "2024-11-15T19:08:04Z")

</div>

Hello All,

I have installed php 8.0 and configured the php.ini file. I can see the elastic\_apm is loaded onto the php extensions.

Now my question is how or where do I get a sample script so that I can send the data from the php to elasticapm observability. Is there a sample code that I can use.

I checked on internet did not find anything useful.

---

<div class="post-metadata">

**Author:** ![Pawel\_Filipczak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pawel_filipczak/32/119132_2.png) [@Pawel\_Filipczak](https://discuss.elastic.co/u/Pawel_Filipczak)\
**Post date:** [November 18, 2024, 8:33am UTC](https://discuss.elastic.co/t/how-to-use-php-agent-with-php/370625/2 "2024-11-18T08:33:46Z")

</div>

Hey @Anubhav_Jha

The Elastic APM agent should automatically monitor supported applications and frameworks. However, if you want to handle some tasks manually, you can use the public SDK API, documented here:

> **[Public API | APM PHP Agent Reference \[1.x\] | Elastic](https://www.elastic.co/guide/en/apm/agent/php/current/public-api.html)**

---

<div class="post-metadata">

**Author:** ![Anubhav\_Jha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anubhav_jha/32/137617_2.png) [@Anubhav\_Jha](https://discuss.elastic.co/u/Anubhav_Jha)\
**Post date:** [November 25, 2024, 7:48am UTC](https://discuss.elastic.co/t/how-to-use-php-agent-with-php/370625/3 "2024-11-25T07:48:27Z")

</div>

Thank you actually I saw this documentation. but its not very in deep. was looking for a step by step guide.

if anything like that it can be of help

Thanks,
