(→확인) |
(→확인) |
||
35번째 줄: | 35번째 줄: | ||
| date.timezone||Europe/Berlin||Europe/Berlin | | date.timezone||Europe/Berlin||Europe/Berlin | ||
|} | |} | ||
다음을 실행해 보자. | |||
<source lang='dos'> | |||
[root@localhost ~]# php -i | grep timezone | |||
PHP Warning: Unknown: 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/Seoul' for 'KST/9.0/no DST' instead in Unknown on line 0 | |||
Default timezone => Asia/Seoul | |||
date.timezone => no value => no value | |||
</source> | |||
[[분류:PHP]] | [[분류:PHP]] | ||
[[분류:시간]] | [[분류:시간]] |
2012년 3월 2일 (금) 15:20 판
1 문제상황
서버 시계는 맞는데, PHP에서 시계가 맞지 않는다. 아래 PHP 소스를 실행했더니 8시간 빠른 시각이 나온다.
PHP
Copy
echo date("Y-m-d H:i:s", time());
2 확인
- phpinfo();를 확인해보니 다음과 같았다.
date/time support | enabled |
"Olson" Timezone Database Version | 2011.8 |
Timezone Database | internal |
Default timezone | Europe/Berlin |
Directive | Local Value | Master Value |
date.default_latitude | 31.7667 | 31.7667 |
date.default_longitude | 35.2333 | 35.2333 |
date.sunrise_zenith | 90.583333 | 90.583333 |
date.sunset_zenith | 90.583333 | 90.583333 |
date.timezone | Europe/Berlin | Europe/Berlin |
다음을 실행해 보자.
bat
Copy
[root@localhost ~]# php -i | grep timezone
PHP Warning: Unknown: 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/Seoul' for 'KST/9.0/no DST' instead in Unknown on line 0
Default timezone => Asia/Seoul
date.timezone => no value => no value
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.
- 분류 댓글:
- PHP (8)
PHP 파일 다운로드 구현 2 (한글 파일명 지원) ― …PHP에서 오라클 DB 사용 ― YoWuPHP 파일 업로드 구현 ― 일리단사오육칠PHP 파일 업로드 구현 ― JmnotePHP 파일 다운로드 구현 2 (한글 파일명 지원) ― AnmkstLib my.php ― 신정섭Lib my.php ― Jmnote로또번호 생성 ―Pinkcrimson