Troubleshooting Sentry PHP logging

Hi,

I am supporting an older app written with Slim Framework 2.

I have integrated the Sentry PHP SDK and I can log exceptions from my local machine.

On the client’s servers nothing seems to get through to Sentry. I’ve tried adding the http_proxy option when calling init() but with no result.

No errors in PHP logs.

Is there a way I can trace this to see where the call is failing?

Thanks!

You can try to set some other options for curl_method.

I guess that you are using the old PHP SDK(legacy).

Hi @urbanc

Thanks for your reply.

I have ruled out the need for a proxy. So I now need to find what’s going wrong within the PHP code.

I am using the Unified PHP SDK.
Sorry I should have included the require section of my composer.json:

 "require": {
    "slim/slim": "~2.0",
    "slim/views": "0.1.3",
    "twig/twig": "~1.18",
    "slim/pdo": "^1.9",
    "phpmailer/phpmailer": "^5.2",
    "monolog/monolog": "^1.23",
    "phpoffice/phpspreadsheet": "^1.1",
    "sentry/sdk": "^2.0"
  }

Looking through https://docs.sentry.io/error-reporting/configuration/?platform=php it seems there are no debug options.

Anything else I could try?

Thanks
Joe

1 Like

OK it turned out to be out of date CA certificates required by PHP. This is on Windows 2012 by the way.

I fixed this by downloading the latest file from https://curl.haxx.se/docs/caextract.html and adding this to php.ini:

[curl]
curl.cainfo = "D:\php_cert\cacert.pem"

thanks, worked for me too - how did you arrive to this solution?

@krabats sorry, I can’t remember exactly. I think I may have used some openssl tools or curl to do some troubleshooting.