Setting default timezone does not work despite timezone being valid

前端 未结 2 1275
难免孤独
难免孤独 2020-12-10 08:03

I\'m geting when I just do phpinfo()

Warning: phpinfo(): It is not safe to rely on the system\'s timezone settings. You are required to use t

相关标签:
2条回答
  • 2020-12-10 08:11

    To extend futureboxlab's solution, you may encounter another error regarding the 'make' command if you don't have make installed. In that case you'll just need to run

    #yum install make
    

    then, once again (third time's the charm)

    #pecl install timezonedb
    
    0 讨论(0)
  • 2020-12-10 08:24

    Thanks to the comments, I was able to solve my problem. What I've done, in console:

    #yum install php-pear
    
    #pecl install timezonedb
    

    It required c compiler:

    configure: error: no acceptable C compiler found in $PATH
    

    ...so I did:

    #yum install gcc
    

    Also, if you get an error about the make command, simply run

    #yum install make
    

    Finally, try again:

    #pecl install timezonedb
    

    ...it displays at the end:

    You should add "extension=timezonedb.so" to php.ini
    

    I added "extension=timezonedb.so" to /etc/php.ini, and restarted php-fpm:

    #/etc/init.d/php-fpm restart
    
    0 讨论(0)
提交回复
热议问题