After the updating homebrew, I have an issue with timezonedb. Brew updated "Olson" Timezone Database Version, but it shouldn't be a problem because of timezonedb extension. The problem is: php uses the internal timezone db instead of external one.
Extension installation process:
sudo pecl install timezonedb-2022.5
, the version isn't the last, but I need it..ini
file from the conf.d catalog: extension=timezonedb.so
For now if I run the command: php -i | grep -i timezone
I received
"Olson" Timezone Database Version => 2022.7
Timezone Database => internal
Default timezone => UTC
date.timezone => no value => no value
timezonedb
Alternative Timezone Database => enabled
Timezone Database Version => 2022.5
It means, that the interpreter sees the installed extension but it is still using the internal database. How can I fix it and use the external one?
php version is 8.1, but I tried with different ones. Php was installed using homebrew + symlink for the particular version (brew install php@8.1 && brew link php@8.1
). Other extensions work properly
I fixed it by manually downgrading the minor version PHP to 8.1.7. The guide is below:
Reinstall icu4c
using the command brew reinstall icu4c.rb
. Check the Cellar: /usr/local/Cellar/icu4c/
. You should have the 70.1
catalog.
Remove an old symlink rm /usr/local/opt/icu4c
Create a new one: ln -s /usr/local/Cellar/icu4c/70.1 /usr/local/opt/icu4c
Patch the ruby config for PHP. Remove depends_on "icu4c"
to avoid downloading the last version of icu4c
, save it
Reinstall PHP brew reinstall php.rb
. If it's not default, symlink it.