Set locale for php
php is left adrift from the system locale settings so we need to be set it explicitly for use system-wide. php is assumed already installed.
2021-11-01 Raspbian buster-bullseye, Ubuntu 20.04-22.04, macOS 15.5
This example uses:
- php version
- 7.4, sometimes commands use 74.
- Locale
- en_AU.UTF-8
- Timezone
- Australia/Melbourne
linux
graham:~ sudo vi /etc/php/7.4/*/php.ini/etc/php/7.4/*/php.ini
change settings
intl.default_locale = en_AU.UTF-8
date.timezone = Australia/Melbourne
- Verify that the settings have taken effect.
If php-fpm was one of the php.ini
files updated:
macOS macports
From macOS 15.x monterey
, php is no longer pre-installed.
We assume use of MacPorts
to have already installed php 7.4.
- Update settings as for linux above.
- Similarly, test settings as for linux above.
If php-fpm is installed:
graham:~ sudo launchctl stop org.macports.php74-fpm graham:~ ps -ef | grep 'php.*-fpm' | grep -v grep 0 11241 1 0 7:20pm ?? 0:00.01 /opt/local/bin/daemondo --label=php74-fpm --start-cmd /opt/local/sbin/php-fpm74 ; --pid=exec- The php-fpm service is restarted automatically; do not restart it yourself.
-
Verify that the start time on the
php74-fpm
process above corresponds to when you stopped the service (and allowed it to restart).