php.iniの場所
普通は/etc/php.ini
。
文字コード
もし必要なら変更。
1 2 3 |
; PHP's default character set is set to UTF-8. ; http://php.net/default-charset default_charset = "UTF-8" |
mbstring
をインストールしている場合、mbstring.internal_encoding
は非推奨となっていて、internal_encoding
やdefault_charset
が使われるようだ。
1 2 3 4 5 6 |
; Use of this INI entry is deprecated, use global internal_encoding instead. ; internal/script encoding. ; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) ; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. ; The precedence is: default_charset < internal_encoding < iconv.internal_encoding ;mbstring.internal_encoding = |
internal_encoding
の方も、指定していなければdefault_charset
が使われるとのこと。
1 2 3 4 |
; PHP internal character encoding is set to empty. ; If empty, default_charset is used. ; http://php.net/internal-encoding ;internal_encoding = |
タイムゾーン
コメントアウトを外し”Asia/Tokyo”を追記。
1 2 3 4 |
[Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = "Asia/Tokyo" |
ブラウザーへのエラー表示
ブラウザーへのエラー表示を有効化のためoff→onに変更。ただし運用時はoffに。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
; This directive controls whether or not and where PHP will output errors, ; notices and warnings too. Error output is very useful during development, but ; it could be very dangerous in production environments. Depending on the code ; which is triggering the error, sensitive information could potentially leak ; out of your application such as database usernames and passwords or worse. ; For production environments, we recommend logging errors rather than ; sending them to STDOUT. ; Possible Values: ; Off = Do not display any errors ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) ; On or stdout = Display errors to STDOUT ; Default Value: On ; Development Value: On ; Production Value: Off ; http://php.net/display-errors display_errors = on |