# Elastic APM PHP Tracer. Sending events to APM Server failed. Exiting...; resultCode: resultFailure (6);

**URL:** <https://discuss.elastic.co/t/elastic-apm-php-tracer-sending-events-to-apm-server-failed-exiting-resultcode-resultfailure-6/359685>\
**Category:** APM\
**Tags:** php\
**Created:** [May 17, 2024, 8:15am UTC](https://discuss.elastic.co/t/elastic-apm-php-tracer-sending-events-to-apm-server-failed-exiting-resultcode-resultfailure-6/359685 "2024-05-17T08:15:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julian\_Fazri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julian_fazri/32/15921_2.png) [@Julian\_Fazri](https://discuss.elastic.co/u/Julian_Fazri)\
**Post date:** [May 17, 2024, 8:15am UTC](https://discuss.elastic.co/t/elastic-apm-php-tracer-sending-events-to-apm-server-failed-exiting-resultcode-resultfailure-6/359685/1 "2024-05-17T08:15:25Z")

</div>

Hi All, got error when I install APM agent for PHP. I have follow the documentation from [APM PHP Agent Reference [1.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/php/current/index.html)

But I still got no clues what is the problem.

**Kibana version** : 8.12

**Elasticsearch version** : 8.12

**APM Server version** : 8.12

**APM Agent language and version** : php v1

**Browser version** : any version

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

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

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? No

**Steps to reproduce** :

1. Install APM Server
2. Install APM Agent for PHP on linux
3. Restart httpd and php-fpm server

**Provide logs and/or server output (if relevant)**: Sending events to APM Server failed; URL: `http://jlnfleetsvr.julian.local:8200/intake/v2/events';error message: `Couldn't connect to server'; curl info: {version: 7.76.1, ssl\_version:OpenSSL/3.0.7, libz\_version: 1.2.11, host: x86\_64-redhat-linux-gnu. Exiting...; resultCode: resultFailure (6);

I got those error from php service status.

Hope someone can help me here. I found the previous topic that match my problem, but the topic was closed without any resolution [Elastic APM PHP Tracer - Sending events to APM Server failed](https://discuss.elastic.co/t/elastic-apm-php-tracer-sending-events-to-apm-server-failed/260445). Hope someone can help me for this.

Thanks

---

<div class="post-metadata">

**Author:** ![Sergey\_Kleyman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergey_kleyman/32/39333_2.png) [@Sergey\_Kleyman](https://discuss.elastic.co/u/Sergey_Kleyman)\
**Post date:** [May 17, 2024, 8:25am UTC](https://discuss.elastic.co/t/elastic-apm-php-tracer-sending-events-to-apm-server-failed-exiting-resultcode-resultfailure-6/359685/2 "2024-05-17T08:25:16Z")

</div>

Welcome back @Julian_Fazri

Could you please enable verbose log for agent's communication with APM Server as described at [Troubleshooting | APM PHP Agent Reference [1.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/php/current/troubleshooting.html#enable-verbose-log-backend-comm)  
and provide the resulted logs?

Please note that log might contain security sensitive data (such as your API key or secret token) so make sure to redact the logs before pasting here.

---

<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:** [May 17, 2024, 8:41am UTC](https://discuss.elastic.co/t/elastic-apm-php-tracer-sending-events-to-apm-server-failed-exiting-resultcode-resultfailure-6/359685/3 "2024-05-17T08:41:03Z")

</div>

Curl result code 6 might be related to problem with name resolution. Could you please follow instructions from Sergey and verify if you can reach (ping) `jlnfleetsvr.julian.local` domain from host/container with PHP application (and agent installed)?

---

<div class="post-metadata">

**Author:** ![Julian\_Fazri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julian_fazri/32/15921_2.png) [@Julian\_Fazri](https://discuss.elastic.co/u/Julian_Fazri)\
**Post date:** [May 20, 2024, 5:27am UTC](https://discuss.elastic.co/t/elastic-apm-php-tracer-sending-events-to-apm-server-failed-exiting-resultcode-resultfailure-6/359685/4 "2024-05-20T05:27:08Z")

</div>

Hi Sergey,

I have change the domain with IP and enable verbose mode. On log written Immediate connect fail for 192.168.12.225: Permission denied. I am not using api key and write the secret correctly. What I need to check next?

---

<div class="post-metadata">

**Author:** ![Julian\_Fazri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julian_fazri/32/15921_2.png) [@Julian\_Fazri](https://discuss.elastic.co/u/Julian_Fazri)\
**Post date:** [May 20, 2024, 5:28am UTC](https://discuss.elastic.co/t/elastic-apm-php-tracer-sending-events-to-apm-server-failed-exiting-resultcode-resultfailure-6/359685/5 "2024-05-20T05:28:25Z")

</div>

Hi Pawel,

ping works fine from php host. I also change the domain with IP, but got the same error. I enable verbose mode. On log written "Immediate connect fail for 192.168.12.225: Permission denied". I am not using api key and write the secret correctly. What I need to check next?

---

<div class="post-metadata">

**Author:** ![Julian\_Fazri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julian_fazri/32/15921_2.png) [@Julian\_Fazri](https://discuss.elastic.co/u/Julian_Fazri)\
**Post date:** [May 20, 2024, 7:38am UTC](https://discuss.elastic.co/t/elastic-apm-php-tracer-sending-events-to-apm-server-failed-exiting-resultcode-resultfailure-6/359685/6 "2024-05-20T07:38:13Z")

</div>

Hi @Sergey_Kleyman and @Pawel_Filipczak,

I have solved my problem. I don't know why, but I need to disable my selinux on apm-agent host. After I set selinux disabled and restart the host, data successfully sent to apm-server.
