Elastic APM PHP Tracer - Sending events to APM Server failed

Elasticsearch version:

6.8.4

APM Server version:

7.6.0

APM Agent language and version:

apm-agent-php 1.0.0-beta1

PHP version:

7.2.34

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

Using RPM package (apm-agent-php-1.0.0_beta1-1.noarch.rpm)

Fresh install or upgraded from other version?

Fresh install

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

Hi,

I followed the docs at https://www.elastic.co/guide/en/apm/agent/php/current/intro.html to attach the elastic-apm-php agent to my application and added the configurations to the php.ini file. When I run my application I get the following error:-

Elastic APM PHP Tracer [PID: 4790] 2021-01-07 13:10:22.365282+00:00 [ERROR] [Backend-Comm] [backend_comm.c:161] [sendEventsToApmServer] Sending events to APM Server failed. URL: `http://localhost:8200/intake/v2/events'. Error message: Couldn't connect to server.

The apm-server is reachable from the application instance, the trace data for java-agent is visible and I get the above error only for php-agent .

Kindly help me resolve this issue.

Thank You

Steps to reproduce:

1.Followed PHP agent docs.
2.restarted httpd
3.restarted apm-server

Hi @bimanarajesh - welcome back to the forums :slight_smile:

Could please clarify if APM Server is running at localhost:8200 or a different address:port? If it is the latter did you configure server_url (for example by setting elastic_apm.server_url in php.ini)?

Hi @Sergey_Kleyman ,

The APM Server is running on a different IP address. The port 8200 and the server is accessible from the client instance.
Yes, I did set the elastic_apm.server_url in php.ini file.

Elastic APM PHP Tracer [PID: 4790] 2021-01-07 13:10:22.365282+00:00 [ERROR] [Backend-Comm] [backend_comm.c:161] [sendEventsToApmServer] Sending events to APM Server failed. URL: http://ip:8200/intake/v2/events'. Error message: Couldn't connect to server'.