0

On my localhost, no problem, everything works fine. But on my prod server, the event trigger no work.

I can subscribe and listen my events with js. But my debug console never receive my events.

And I saw some people mentionning timezone. I discovered:

  • my debug console has UTC time ('eu' cluster)
  • php localhost: UTC
  • php prod: Europe/Paris

(I dont know if matters, but the timezone app.php of my Laravel is UTC)

Alright, we may have something here. The problem is that I'm ona shared hosting, and I cannot change the php.ini.

So guys, any clue about this ? How could I do to make work my events on the prod server ?

nicolasca
  • 91
  • 1
  • 8
  • perhaps use VPS, if you cant hack around your timezone with http://php.net/manual/en/function.date-default-timezone-set.php or set config value `timezone` (`app.php`) – Kyslik Jun 22 '17 at 11:33
  • What makes you suspect that the problem is due to timezones? Do you get any errors in your log when triggering events on your server? – jameshfisher Jun 22 '17 at 13:18
  • I just found it with the support ! It was timezone :) I just needed to put the Laravel timezone in app.php to Europe/Paris for make it work in production ! – nicolasca Jun 22 '17 at 13:37
  • If the problem is time-related, it's more likely to be due to the absolute time on your server being wrong. [Pusher uses the timestamp from your local machine to authorize your trigger requests.](https://pusher.com/docs/rest_api#authentication) – jameshfisher Jun 22 '17 at 13:39
  • Please read [the timezone best practices article](https://stackoverflow.com/questions/2532729/daylight-saving-time-and-time-zone-best-practices), especially note: "On servers, set hardware clocks and OS clocks to UTC rather than a local time zone." This also applies to application-wide config files. Handle time zone on a case-by case basis in your code, not globally in your config. – Matt Johnson-Pint Jun 22 '17 at 19:13

1 Answers1

1

I just found it with the support ! It was the timezone :) I just needed to put the Laravel timezone in app.php to Europe/Paris for make it work in production !

So I need to have a config for the timezone. One for the localhost, one for the production.

nicolasca
  • 91
  • 1
  • 8