0

I am using laravel with forge. I have papertrail set and and different commands that should be triggered at specific time. i.e. 4am.

I noticed today that it still didnt run the command so I did some digging. Now my system time is:

     Local time: Fri 2017-09-15 09:00:55 BST
  Universal time: Fri 2017-09-15 08:00:55 UTC
        RTC time: Fri 2017-09-15 08:00:55
       Time zone: Europe/London (BST, +0100)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

Which is correct. However, my papertrail is telling me from the logs:

Sep 15 01:00:55 CRON: pam_unix(cron:session): session closed for user forge

So it seems like laravel/php is behind. Timezone in app.php is set to 'timezone' => 'Europe/London'

What else could be wrong?

7
  • Just a guess as I no longer develop on Laravel. Are the commands run by php cli? If so, then specifying the correct timezone in php.ini could help. Commented Sep 15, 2017 at 8:15
  • Either that, or the application (Laravel) is using a different timezone. check your timezone in config/app.php Commented Sep 15, 2017 at 8:32
  • I've set both in php.ini and laravel config to Europe/London and still the same Commented Sep 15, 2017 at 8:41
  • Have you checked that you don't have a separate php.ini for php cli? And did you restart php process and/or webserver? Commented Sep 15, 2017 at 8:43
  • I checked php --ini and found which one it is using. And yes I did Commented Sep 15, 2017 at 8:44

2 Answers 2

0

maybe it works for you:

in app/Providers/AppServiceProvider.php there a boot function. add following to that:

date_default_timezone_set('Your/TimeZone');
Sign up to request clarification or add additional context in comments.

Comments

0

You have to set the correct timezone in the config/app.php file. I think that the Laravel sets the time for you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.