fastsol Posted June 9, 2015 Share Posted June 9, 2015 Is there a way via php script to sync a servers time? I have a dedicated server on a webhost and I can go in a sync it manually, but I would really rather not have to remember to do that every so often. I have read that a NTP can be setup, but I have zero knowledge of doing command line stuff like all the examples show to do. I was hoping for a php version of code that could accomplish the same thing. The reason I need to make sure it's synced is I ran into an issue with a Google API last night that stopped allowing me to authorize cause the time Google saw was not within range of what it wanted. Once I synced the server time, it let me authorize with the API. I don't want my website to break periodically if I forget to sync the time, so an automatic sync would certainly be best. Quote Link to comment https://forums.phpfreaks.com/topic/296719-keping-server-time-synced/ Share on other sites More sharing options...
requinix Posted June 9, 2015 Share Posted June 9, 2015 Rather than use the hammer you know to hammer in a screw, learn to use a screwdriver. Install ntp/ntpd/whatever the name of the package is called on your (presumably Linux) distro. And make sure the system is using the right timezone. That's it. Quote Link to comment https://forums.phpfreaks.com/topic/296719-keping-server-time-synced/#findComment-1513551 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.