1

重複の可能性:
PHP - システムのタイムゾーン設定に依存するのは安全ではありません

私は symfony 1.4/propel 1.4 で既存のプロジェクトを持っています。プロダクション サーバー (RedHat) と私のローカル開発環境 (Windows 7 の WAMP サーバー) で問題なく動作しています。

イントラネットを介したローカル オフィスのテスト用に、OpenSuse 12.1 で実行される新しいスケーリング サーバーを設定しています。

すべて問題ありませんが、HTML ページで次の警告が表示されます

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Calcutta' for 'IST/5.0/no DST' instead in /home/admin/svntestco/troupasvn/trunk/lib/vendor/symfony/lib/config/sfRootConfigHandler.class.php on line 91

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Calcutta' for 'IST/5.0/no DST' instead in /home/admin/svntestco/troupasvn/trunk/lib/vendor/symfony/lib/config/sfDefineEnvironmentConfigHandler.class.php on line 66

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Calcutta' for 'IST/5.0/no DST' instead in /home/admin/svntestco/troupasvn/trunk/lib/vendor/symfony/lib/config/sfDefineEnvironmentConfigHandler.class.php on line 66

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/admin/svntestco/troupasvn/trunk/lib/vendor/symfony/lib/config/sfRootConfigHandler.class.php:91) in /home/admin/svntestco/troupasvn/trunk/lib/vendor/symfony/lib/storage/sfSessionStorage.class.php on line 93

Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in /home/admin/svntestco/troupasvn/trunk/lib/vendor/symfony/lib/storage/sfSessionStorage.class.php on line 171

Warning: Cannot modify header information - headers already sent by (output started at /home/admin/svntestco/troupasvn/trunk/lib/vendor/symfony/lib/config/sfRootConfigHandler.class.php:91) in /home/admin/svntestco/troupasvn/trunk/lib/vendor/symfony/lib/response/sfWebResponse.class.php on line 336

Warning: Cannot modify header information - headers already sent by (output started at /home/admin/svntestco/troupasvn/trunk/lib/vendor/symfony/lib/config/sfRootConfigHandler.class.php:91) in /home/admin/svntestco/troupasvn/trunk/lib/vendor/symfony/lib/response/sfWebResponse.class.php on line 357

タイムゾーンの設定に問題があることはわかっていますが、修正方法がわかりません。使用中の php.ini ファイルを見つけようとしましたが、Yast を介して php がインストールされたため、見つけることができませんでした。誰かがファイル名 (おそらく php.ini)、opensuse 上のその場所、およびそれを修正するために必要な変更を教えてください。

Apache ではなく、nginx を使用していることに注意してください。

4

1 に答える 1

1

Symfony の場合、 php_intl拡張機能がインストールされていることを確認してください。問題がありました。

2 つ目は、 php.iniファイルでタイムゾーンを設定する必要があることです。

php.ini :

[Date]
; Defines the default timezone used by the date functions
date.timezone = Europe/Berlin 

例えば。

于 2012-10-11T12:26:01.580 に答える