<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>デフォルトタイムゾーン on qwerty.work</title>
        <link>https://qwerty.work/tags/%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E3%82%BF%E3%82%A4%E3%83%A0%E3%82%BE%E3%83%BC%E3%83%B3/</link>
        <description>Recent content in デフォルトタイムゾーン on qwerty.work</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>ja-JP</language>
        <lastBuildDate>Wed, 09 Sep 2015 00:17:00 +0900</lastBuildDate><atom:link href="https://qwerty.work/tags/%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E3%82%BF%E3%82%A4%E3%83%A0%E3%82%BE%E3%83%BC%E3%83%B3/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>PHPのバージョンアップで発生するタイムゾーンエラーの対処方法</title>
            <link>https://qwerty.work/post/2015/09/php-error-defaulttimezone/</link>
            <pubDate>Wed, 09 Sep 2015 00:17:00 +0900</pubDate>
            <guid>https://qwerty.work/post/2015/09/php-error-defaulttimezone/</guid>
            <description>&lt;p&gt;使用しているレンタルサーバーのバージョンが上がったせいか、今まで正常に動いていたPHPのスクリプトでエラーが出始めた。&lt;/p&gt;&#xA;&lt;h3 id=&#34;エラーの内容&#34;&gt;エラーの内容&#xA;&lt;/h3&gt;&lt;p&gt;なにやらデフォルトの&lt;strong&gt;タイムゾーン&lt;/strong&gt;を設定しろ的な**date_default_timezone_set()**に関するエラー。&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt;: date(): It is not safe to rely on the system&amp;rsquo;s timezone settings. You are &lt;em&gt;required&lt;/em&gt; 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 the timezone &amp;lsquo;UTC&amp;rsquo; for now, but please set date.timezone to select your timezone. in /public_html/qwerty.work/lib/***.php on line 123&lt;/p&gt;&#xA;&lt;h3 id=&#34;対処法方法&#34;&gt;対処法方法&#xA;&lt;/h3&gt;&lt;p&gt;タイムゾーンの設定はphp.iniか.htaccessでするか、スクリプト内に宣言するかなどできます。&lt;/p&gt;&#xA;&lt;h4 id=&#34;phpiniの場合&#34;&gt;php.iniの場合&#xA;&lt;/h4&gt;&lt;p&gt;[Date]セクション内を編集&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;;date.timezone =&#xA;  　　　↓↓↓&#xA;date.timezone = Asia/Tokyo&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;※スクリプト全てに対して適用されます&lt;/p&gt;&#xA;&lt;h4 id=&#34;htaccessの場合&#34;&gt;.htaccessの場合&#xA;&lt;/h4&gt;&lt;p&gt;以下を追加&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;php_value date.timezone Asia/Tokyo&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;※.htaccess制御範囲内のスクリプト全てに対して適用されます&lt;/p&gt;&#xA;&lt;h4 id=&#34;スクリプト内で宣言する場合&#34;&gt;スクリプト内で宣言する場合&#xA;&lt;/h4&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-php&#34; data-lang=&#34;php&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;date_default_timezone_set&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Asia/Tokyo&amp;#39;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;※記述を追加したスクリプトのみに対して適用されます&lt;/p&gt;&#xA;</description>
        </item></channel>
</rss>
