im using PHP Version 7.0.31 on a Plesk Onyx system.
phpinfo() is showing me:
date
date/time support: enabled
timelib version: 2016.02
"Olson" Timezone Database Version 0.system
Timezone Database internal
Default timezone Europe/Berlin
The used timelib version "2016.02" is outdated so i need to upgrade it to the current version 2018.5 (https://pecl.php.net/package/timezonedb).
How to do that? "pecl upgrade timezonedb" didn't worked out and after hours of googling and trying i'm clueless...
I've solved a similar problem in my company, but related to daylight saving time in Brazil. The time was 1 hour wrong in all our servers that uses PHP 7.0.32, while the servers that uses PHP 7.1 are working fine.
Our servers are running on AWS EC2 instances. Our timezone is America/Sao_Paulo
. It's important to note that our main goal was "update timelib PHP extension", but we found that was not needed, since updating the timezone database version was enough to solve our problem.
In order to solve that outdated datetime, I've run the following commands from SSH, logged in as root user:
pecl7 install timezonedb
After that, we need to add the extension to our PHP.INI file. In my case it was loaded and located from /etc/php.ini
. To check yours, just create a phpinfo.php file and check from which location your machine is loading the php.ini file:
Then, just run somewhat like:
nano /etc/php.ini
And then add the following line to the last line of your php.ini file:
extension=timezonedb.so
In order to check if the update has made sucessfully, restart php / php-fpm with the following command:
service php-fpm restart
Then, let's access again the PHPINFO and...