今回、Pleskで管理しているGMO VPSで運用しているPHPアプリケーションのタイムゾーンが変更されていない問題があったのでその対応について共有します。
サーバータイムゾーンを変更しただけでは十分でない
Pleskで管理しているUbuntu22.4.3のサーバーですが、そのサーバータイムゾーン変更はTool & Setting > System Time
で変更が可能です。

`System Time`を押下したら下図の画面が出るのでTime zoneの項目でリストから選択したら変更完了です。

PHPシステムの場合はこれだけではタイムゾーン変更は充分ではありません。
phpのタイムゾーンを変更するにはさらに設定が必要
順を追って説明していきます。
まずは自身のサイトがどのPHPを利用しているか確認しましょう。
下図だと、PHP8.3.0を利用しています。

次にPHP
メニューを押下してPHPの構成を確認しましょう。

FPM application served by Apache
が利用されています。
現在のPHPに適用されているタイムゾーンを確認する
PHPランタイムに適用されているタイムゾーンの情報はView the phpinfo() page
で確認が可能です。
ぜひ、確認してみてください。

確認してみるとDefault timezone
やdate.timezone
がUTC(標準時)になっていることがわかります。

php.iniを編集してタイムゾーンを変更する
php.ini
を編集するにはTool & Setting > PHP Setting
に移動します。

移動すると自信が利用しているPHPの構成があることがわかります。
実際に利用している構成には画面右側に利用しているドメインの数が表示されます。

今回は8.3.0 FPM application
を押下します。
押下すると下図のような画面に遷移するのでphp.ini
に移動します。

移動したらphp.iniファイルの;date.timezone=
の部分を編集します。

[Date]
; Defines the default timezone used by the date functions
; https://php.net/date.timezone
;date.timezone =
↓ コメントアウトを外す
↓ date.timezone
にタイムゾーンを指定する
[Date]
; Defines the default timezone used by the date functions
; https://php.net/date.timezone
date.timezone = "Asia/Bangkok"
※今回はAsia/Bangkokですが、ご自身のタイムゾーンに変更してください。
編集した後のOKボタンを忘れずに、、

phpのタイムゾーンは下記のページから調べることが可能です。
変更が反映されていることを確認する
ここまで進んだら、Websites & Domains > Your domain > PHP > View the phpinfo() page
からphpinfoを確認してみましょう。

このように変更されていれば完了です。
