Okay To Set Default PHP Timezone to same as Server Timezone?
Generally, with most applications there is either a sitewide timezone setting (like in Wordpress) or a user-specific timezone setting in the user's profile.
I've got an account that the application sometimes has a logged in user that has a user specified timezone, and other times it's just a general user that is not logged in. I would guess it's "safe" to set the default PHP timezone for the entire Cpanel account to the server's timezone. The only circumstance I can see it causing a problem is if there was some sloppy code that had to write UTC datetime to a database record and just assumed the default timezone was UTC without specifically setting it. Am I overlooking anything?
What about setting the default PHP timezone for ALL accounts to the server timezone and then let that be overridden as necessary on a per account basis (especially if if all the current accounts are associated with companies all in the same timezone?) Or is that a bad practice?
-
The default is UTC and you don't need to keep it as such, I would want to make sure to use a supported timezone though and you can find those here: PHP: List of Supported Timezones - Manual A lot of times stuff like this is kept to UTC is to take away complications of having to translate different timezones If that's not an issue for you there shouldn't be any reason not to. You can use the MultiPHP INI Editor at WHM>>Software>>MultiPHP INI Editor and set this per php version for the entire server. 0 -
I changed my timezone in MultiPHP.ini: [Date] ; Defines the default timezone used by the date functions ; PHP: Runtime Configuration - Manual date.timezone = "America/Chicago" When I run "PHP" via command-line it is still using GMT I restarted my server, what did I miss? 0
Please sign in to leave a comment.
Comments
2 comments