[PHP] timezone 설정[PHP] timezone 설정
Posted at 2015. 3. 30. 20:34 | Posted in IT/phpPHP timezone 설정
아래와 같은 에러가 발생시 해결방법
Warning: 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/Seoul' for 'KST/9.0/no DST' instead in () on line 1 |
1. php Ini에서 date.timezone 설정 |
php.ini 파일에서 914번 라인에 있는 라인을 date.timezone =Asia/Seoul 로 변경 해준다.
※ php ini파일은 php경로에 있다. 조금 더 정확한 방법으로 php.ini 파일경로를 알고싶다면 phpinfo()에서 ini파일 경로를 찾을수 있다.
2. php ini 파일을 수정할 수 없는 환경에서의 설정 방법 |
date_default_timezone_set('Asia/Seoul'); // 현재 날짜 관련 함수를 사용할때 이코드를 때려 박아준다
'IT > php' 카테고리의 다른 글
[PHP] IP 주소 관련 (0) | 2015.04.14 |
---|---|
[PHP] array_push() 함수 배열끝에 요소 추가 (0) | 2015.04.12 |
[PHP] json_encode() 한글깨짐 (4) | 2015.03.30 |
[PHP] 날짜 및 시간 관련 함수 모음 (0) | 2015.03.29 |
[PHP] Naver,Google Smtp를 이용한 메일보내기 (11) | 2015.03.22 |