MyBB Community Forums
[How To?] Is there a special step to get MyBB to recognize the TimeZone in a new php.ini file? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: [How To?] Is there a special step to get MyBB to recognize the TimeZone in a new php.ini file? (/thread-158787.html)



Is there a special step to get MyBB to recognize the TimeZone in a new php.ini file? - Der Meister - 2014-09-05

I'm not sure if I'm doing this right.

I created a php.ini file for the sole purpose of setting the timezone.  I have the following content in that file:
[PHP]

date.timezone = "US/Central"


I placed the file in my public_html

When I go into the "View PHP Info" section of my MyBB admin panel, it still says the old time zone.  What am I forgetting or doing wrong?  Is there something else I have to do in order to make the change accepted?  Did I forget something in the file of the php.ini example above?

UPDATE: Looks like now it's giving an error saying US/Central is an invalid timezone and it's choosing UTC for now. How is US/Central invalid? Anybody know how I have to write the time zone if US/Central is considered invalid? Also, I tried America/Central and got the same error. Sad From what I'm finding online when I search, these are correct values. Why the errors?

Invalid date.timezone value US/Central we selected the timezone 'UTC' for now


RE: Is there a special step to get MyBB to recognize the TimeZone in a new php.ini file? - laie_techie - 2014-09-05

Most "valid" timezones mention a city; mine is America/Denver. Maybe set yours to America/Chicago?


RE: Is there a special step to get MyBB to recognize the TimeZone in a new php.ini file? - Der Meister - 2014-09-05

Good idea. I'm not sure why the info I had looked up was saying US/Central for inside of a php.ini file then.

I have made the change and am waiting to see if it goes through. It's been 15 minutes so far and the "View PHP Info" area in my MyBB admin panel still says the old timezone Sad

Am I forgetting a step to make it kick in to action?

UPDATE: It looks like when I copy the php.ini file into the admin directory, it works. So, now I have a copy in the public_html and also in the admin. Does this sound like the correct solution or is there a better way I should have done it?


RE: Is there a special step to get MyBB to recognize the TimeZone in a new php.ini file? - laie_techie - 2014-09-09

You have to restart your webserver (such as Apache) when you change your php.ini file. The location of your php.ini file depends on how it was compiled. If you go to the "View PHP Info" page of the ACP (Admin Control Panel), it will tell you which php.ini file it loaded. BTW, you should NEVER put your php.ini file under public_html.


RE: Is there a special step to get MyBB to recognize the TimeZone in a new php.ini file? - Der Meister - 2014-09-10

There was not one already compiled. I just created a file named php.ini and used it for only 1 purpose- to dictate the time zone. Nothing else at all is in the file.

May I ask what the dangers are of having php.ini in public_html? And if those dangers still apply if I only have 1 thing in the file and it's to change the timezone? Thank you for your advice.


RE: Is there a special step to get MyBB to recognize the TimeZone in a new php.ini file? - laie_techie - 2014-09-11

(2014-09-10, 04:30 AM)Der Meister Wrote: There was not one already compiled.  I just created a file named php.ini and used it for only 1 purpose- to dictate the time zone.  Nothing else at all is in the file.

May I ask what the dangers are of having php.ini in public_html?  And if those dangers still apply if I only have 1 thing in the file and it's to change the timezone?  Thank you for your advice.

Your php.ini contains configuration for PHP. It can give hints for hackers attempting to attack your site. It could contain username and password used to send emails.