# APM agent php issue

**URL:** <https://discuss.elastic.co/t/apm-agent-php-issue/314998>\
**Category:** APM\
**Tags:** php\
**Created:** [September 23, 2022, 7:54am UTC](https://discuss.elastic.co/t/apm-agent-php-issue/314998 "2022-09-23T07:54:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pragadeeswar\_Padmana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pragadeeswar_padmana/32/111158_2.png) [@Pragadeeswar\_Padmana](https://discuss.elastic.co/u/Pragadeeswar_Padmana)\
**Post date:** [September 23, 2022, 7:54am UTC](https://discuss.elastic.co/t/apm-agent-php-issue/314998/1 "2022-09-23T07:54:40Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

TIP 1: select at least one tag that further categorizes your topic. For example `server` for APM Server-related questions, `PHP` for questions regarding the Elastic APM PHP agent, or `ui` for questions about the APM App within Kibana.

TIP 2: Check out the [troubleshooting guide](https://www.elastic.co/guide/en/apm/get-started/current/troubleshooting.html) first. Not only will it help you to resolve common problems faster but it also explains in more detail which information we need before we can properly help you.

**Kibana version** : 8.4.1

**Elasticsearch version** : 8.4.1

**APM Server version** : 8.4.2

**APM Agent language and version** : PHP

**Browser version** :

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

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

**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? Have you changed index pattern, generated custom templates, changed agent configuration etc.

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

**Steps to reproduce** :  
1.  
2.  
3.

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

**Provide logs and/or server output (if relevant)**:  
pool www: [Elastic APM PHP Tracer] 2022-09-23 06:49:01.434659+00:00 [PID: 15772] [TID: 16382] [ERROR] [Backend-Comm] [backend\_comm.c:251] [syncSendEventsToApmServer] Sending events to APM Server failed. URL: `https://ip-10-0-0-131.ap-south-1.compute.internal:8200/intake/v2/events'. Error message: `Couldn't connect to server'. Current process command line: `PHP-fpm: pool www'

---

<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 14, 2022, 3:55am UTC](https://discuss.elastic.co/t/apm-agent-php-issue/314998/2 "2022-10-14T03:55:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Peter\_Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_elastic/32/91235_2.png) [@Peter\_Elastic](https://discuss.elastic.co/u/Peter_Elastic)\
**Post date:** [December 4, 2022, 10:33am UTC](https://discuss.elastic.co/t/apm-agent-php-issue/314998/3 "2022-12-04T10:33:23Z")

</div>



---

<div class="post-metadata">

**Author:** ![Peter\_Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_elastic/32/91235_2.png) [@Peter\_Elastic](https://discuss.elastic.co/u/Peter_Elastic)\
**Post date:** [December 4, 2022, 10:35am UTC](https://discuss.elastic.co/t/apm-agent-php-issue/314998/4 "2022-12-04T10:35:14Z")

</div>

Hi Pragadeeswar Padmanaban,

Could you check the following if the issue is still active:

- Is the url valid?
- Did you set the secret\_token properly?
- Is there a firewall active? Port 8200 might be blocked internally

Greetings,

---

<div class="post-metadata">

**Author:** ![Matthieu\_Baumann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthieu_baumann/32/98686_2.png) [@Matthieu\_Baumann](https://discuss.elastic.co/u/Matthieu_Baumann)\
**Post date:** [December 5, 2022, 11:31am UTC](https://discuss.elastic.co/t/apm-agent-php-issue/314998/5 "2022-12-05T11:31:02Z")

</div>

Hello Peter,

I have the same problem, here's some more info :

- The url is valid and the 8200 port is open : I can curl my apm-server from my php server and get a response.
- When the error occurs, there is nothing appearing in my apm-server's logs
- I tried with 2 different apm-servers, one on a remote server with an API-key and one on a localhost apm-server with no API-key
- Both apm servers already work with the java apm agent

---

<div class="post-metadata">

**Author:** ![Peter\_Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_elastic/32/91235_2.png) [@Peter\_Elastic](https://discuss.elastic.co/u/Peter_Elastic)\
**Post date:** [December 5, 2022, 1:50pm UTC](https://discuss.elastic.co/t/apm-agent-php-issue/314998/6 "2022-12-05T13:50:54Z")

</div>

Can you check the php\_info(); contents to see if the url and secret\_token is filled in?

---

<div class="post-metadata">

**Author:** ![Matthieu\_Baumann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthieu_baumann/32/98686_2.png) [@Matthieu\_Baumann](https://discuss.elastic.co/u/Matthieu_Baumann)\
**Post date:** [December 5, 2022, 2:27pm UTC](https://discuss.elastic.co/t/apm-agent-php-issue/314998/7 "2022-12-05T14:27:07Z")

</div>

Thank you for your quick reply !

I finally managed to retrieve some data. The connection problem is due to SELinux blocking the connection. A quick workaround is to use `setenforce 0`

Sadly, we can't use this workaround in production for obvious reasons, but now we know it's not a configuration problem.
