[PHP] timezone 설정[PHP] timezone 설정

Posted at 2015. 3. 30. 20:34 | Posted in IT/php
홈페이제작업체 NuGuWeb

PHP 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'); 
// 현재 날짜 관련 함수를 사용할때 이코드를  때려 박아준다


//