Setting the Timezone for PHP in the php.ini file

后端 未结 6 1090
轮回少年
轮回少年 2020-11-29 09:00

I\'m trying to change the default PHP timezone to Asia/Calcutta by accessing the /etc/php5/cli/php.ini file and changing

[Date]
;          


        
6条回答
  •  醉酒成梦
    2020-11-29 09:06

    I tried all the other possible solutions posted, but none of them helped. This is what helped me save my timezone settings:

    1) Go to your phpinfo() page and search for Loaded Configuration File and open the php.ini file mentioned under that section.

    2) Change the default timezone settings by adding your new timezone by modifying this line: date.timezone=Asia/Kolkata.

    3) Save the php.ini file and stop the Apache server.

    4) Restart the Apache server. The timezone settings should now be modified.

提交回复
热议问题