# How to install php agent for apm

**URL:** <https://discuss.elastic.co/t/how-to-install-php-agent-for-apm/288331>\
**Category:** APM\
**Tags:** php\
**Created:** [November 3, 2021, 1:24pm UTC](https://discuss.elastic.co/t/how-to-install-php-agent-for-apm/288331 "2021-11-03T13:24:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodri.gz](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@rodri.gz](https://discuss.elastic.co/u/rodri.gz)\
**Post date:** [November 3, 2021, 1:24pm UTC](https://discuss.elastic.co/t/how-to-install-php-agent-for-apm/288331/1 "2021-11-03T13:24:36Z")

</div>

Hello !

I want to test the apm with my php application. My application is on a RHEL server.

I have read the guide but I don't really understand where the files come from.

I understand that when you do the` rpm -ivh` of the ` apm-agent-php-1.3.1-1.noarch.rpm`

this generates the `elastic_apm.so` files and `<repo root> /src/bootstrap_php_part.php`

then you just have to reference these documents in the `php.ini` like this:

```auto
extension=elastic_apm.so
elastic_apm.bootstrap_php_part_file=<repo root>/src/bootstrap_php_part.php

```

I am mistaken? how is it really done?

Thanks in advanced!

---

<div class="post-metadata">

**Author:** ![riferrei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/riferrei/32/104867_2.png) [@riferrei](https://discuss.elastic.co/u/riferrei)\
**Post date:** [November 3, 2021, 1:46pm UTC](https://discuss.elastic.co/t/how-to-install-php-agent-for-apm/288331/2 "2021-11-03T13:46:29Z")

</div>

Hi @rodri.gz,

The steps you followed so far seem to be correct. The only step missing is the configuration of the APM server. Still, in your php.ini file, you should include the following properties:

```auto
extension=elastic_apm.so
elastic_apm.bootstrap_php_part_file=<repo root>/src/bootstrap_php_part.php
elastic_apm.service_name="SomeName"
elastic_apm.server_url="https://cloudid.apm.region.provider.cloud.es.io"
elastic_apm.secret_token="This_Is_Secret"
elastic_apm.environment="Staging"_For_Example"
elastic_apm.service_node_name="machine_node"
elastic_apm.service_version="some_version"

```

For more information about which properties are available, check [this page](https://www.elastic.co/guide/en/apm/agent/php/current/configuration-reference.html).

— @riferrei

---

<div class="post-metadata">

**Author:** ![rodri.gz](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@rodri.gz](https://discuss.elastic.co/u/rodri.gz)\
**Post date:** [November 3, 2021, 1:54pm UTC](https://discuss.elastic.co/t/how-to-install-php-agent-for-apm/288331/3 "2021-11-03T13:54:45Z")

</div>

> [@riferrei](#):
>
> The steps you followed so far seem to be correct. The only step missing is the configuration of the APM server. Still, in your php.ini file, you should include the following properties:

Yes! I forgot to say that I had already installed it and it seems to be correct.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/1/011a07601aeecc1abefac8e3a389871dc2c9de31.png)

Perfect im going to try it . The \< repo root \> is the ~/root by default , another folder or a repository?

Thank you very much for answering and answering so quickly!

---

<div class="post-metadata">

**Author:** ![riferrei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/riferrei/32/104867_2.png) [@riferrei](https://discuss.elastic.co/u/riferrei)\
**Post date:** [November 3, 2021, 1:57pm UTC](https://discuss.elastic.co/t/how-to-install-php-agent-for-apm/288331/4 "2021-11-03T13:57:42Z")

</div>

> [@rodri.gz](#):
>
> The \< repo root \> is the ~/root by default , another folder or a repository?

It should be a location that your PHP code can reach — whether absolute or relative to the path. As an example, consider this:

```auto
elastic_apm.bootstrap_php_part_file=/opt/elastic/apm-agent-php/src/bootstrap_php_part.php

```

— @riferrei

---

<div class="post-metadata">

**Author:** ![rodri.gz](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@rodri.gz](https://discuss.elastic.co/u/rodri.gz)\
**Post date:** [November 3, 2021, 1:58pm UTC](https://discuss.elastic.co/t/how-to-install-php-agent-for-apm/288331/5 "2021-11-03T13:58:56Z")

</div>

i'll try taht.

Perfect , Thank you soooo much!!

---

<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:** [November 24, 2021, 9:59am UTC](https://discuss.elastic.co/t/how-to-install-php-agent-for-apm/288331/6 "2021-11-24T09:59:23Z")

</div>

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