# How can I define these variables at PHP.ini?

**URL:** <https://discuss.elastic.co/t/how-can-i-define-these-variables-at-php-ini/315908>\
**Category:** APM\
**Tags:** php\
**Created:** [October 5, 2022, 7:15pm UTC](https://discuss.elastic.co/t/how-can-i-define-these-variables-at-php-ini/315908 "2022-10-05T19:15:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GustavoPires](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GustavoPires](https://discuss.elastic.co/u/GustavoPires)\
**Post date:** [October 5, 2022, 7:15pm UTC](https://discuss.elastic.co/t/how-can-i-define-these-variables-at-php-ini/315908/1 "2022-10-05T19:15:04Z")

</div>

Hello,

I am using Fleetserver and integration with elastic APM, and PHP agent at my application (php.ini). I don't know if I configured `elastic_apm.server_url` at `php.ini` properly. I want to understand how its works. What are `Host` and `URL`, for example, setting up through integration I only need to put my Elasticsearch URL and the port? Or do I need to set up APM SERVER too? How is data sent (I released port 8200 on the firewall and I don't see any data being sent)? It's funny because it is working, on APM Services I can see my application data, for example, but I can't rename `elastic_apm.service_name`, whatever I put in there, at APM services only show `unknown-php-service`.

Integration Configuration  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/7/974f534324896b49d43e0300a53786d2e810ebc8.png)

APM \> Services

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/b/9b28528b05ababd626429370db24bcaea35cff40.png)

PHP.ini

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/8/88f1ece2490b6e49a47121ce9d751cc7cd7ce5b7.png)

---

<div class="post-metadata">

**Author:** ![marone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marone/32/87145_2.png) [@marone](https://discuss.elastic.co/u/marone)\
**Post date:** [October 7, 2022, 4:18pm UTC](https://discuss.elastic.co/t/how-can-i-define-these-variables-at-php-ini/315908/2 "2022-10-07T16:18:52Z")

</div>

Hello @GustavoPires,

Yes I agree with you if it's your first time setting up APM with fleet it's quite confusing. For me I set up the value of `Host` with `0.0.0.0:8200`, and for `URL`, you have to set it to your public DNS or public IP, I believe 192.168.19.40 is a local ip address. In this case your agent is sending apm data as shown in Kibana, because the agent and your app are in the same local network. Additionally, if you plan to use RUM JS in your frontend, you have to use your public IP or DNS for the apm server url parameter!

Also, why on Kibana it's showing `unknown-php-service`, because the `elastic_apm.service_name` is not well set up, it tooks the default value (check [here](https://www.elastic.co/guide/en/apm/agent/php/current/configuration-reference.html#config-service-name)). Maybe try this with double quotes in your PHP.ini:

```auto
elastic_apm.service_name = "my-php-service"

```

Hope it helps,

Marwane.

---

<div class="post-metadata">

**Author:** ![GustavoPires](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GustavoPires](https://discuss.elastic.co/u/GustavoPires)\
**Post date:** [October 7, 2022, 4:45pm UTC](https://discuss.elastic.co/t/how-can-i-define-these-variables-at-php-ini/315908/3 "2022-10-07T16:45:51Z")

</div>

> [@marone](#):
>
> ```auto
> elastic_apm.service_name = "my-php-service"
> 
> ```

My elastic\_apm.service\_name was:

```auto
elastic_apm.service_name = "a"

```

But nothing appears different, only the same name "my-php-service".  
My environment is an on-premises elastic stack, `192.168.19.40` is my elasticsearch IP.  
I will try to make that changes! Thanks very much for the answers.

---

<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:** [October 28, 2022, 12:46pm UTC](https://discuss.elastic.co/t/how-can-i-define-these-variables-at-php-ini/315908/4 "2022-10-28T12:46:25Z")

</div>

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