CHALLENGE
I changed the date.timezone
in the php.ini
file, and when I entered php-i
in my terminal, it showed me the correct date.timezone
, however the new date.timezone
wasn't reflecting in my <?phpinfo()
page on localhost.
THINGS I TRIED
I know that when a change is made to the php.ini
file, the server has to be restarted. I am using the built in Apache server on MacOS, and the commands I have used so far are
- sudo apachectl restart
- sudo apachectl graceful
- apachectl -k restart
All these failed to reflect the new date.timezone
in my phpinfo()
localhost page, when I refreshed the page.
HOW I SOLVED THE CHALLENGE
I had a similar issue in the past with this same configuration, when I changed the default php version on my laptop. The terminal command php -v
showed the new version, but the <?phpinfo()
page wasn't reflecting the new version, even after using the Apache restart commands stated above and refreshing the page. On a whim, I decided to restart my laptop and the <?phpInfo()
localhost page reflected the new php version.
I decided to restart my computer after many painful attempts at restarting my Apache server and refreshing the <?phpinfo()
localhost page didn't reflect the new date.timezone
- it worked.
QUESTION
Why do I need to restart my computer for changes to be reflected in the <?phpinfo()
localhost page? It doesn't seem right to me.