메뉴 닫기

php timezone 설정

 

Warning: phpinfo(): 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 the timezone ‘UTC’ for now, but please set date.timezone to select your timezone.

 

php를 설치하고, phpinfo 페이지를 출력했을때 date 부분에서 다음과 같은 에러 가 출력되는 것을 확인할수있다.

해당 부분은 php.ini timezone 설정이 되지않아서 출력되는 부분이다. 

다음과 같이 php.ini 에 해당 구문을 설정해주면 된다.

vi /usr/local/apache/conf/php.ini

timezone1

 

현재 php.ini 에 date 항목에 date.timezone에 주석처리및 값이 설정되어있지않습니다.

 

timezone2

 

해당부분을 주석해제 하고, 다음과 같이  Asia/Seoul 를 입력해줍니다.

저장하고, 다시 phpinfo페이지에 date 부분을 확인을하면, 에러가 출력되지않는것을 확인할수있습니다.

감사합니다!

 

 [polldaddy rating=”7739789″]

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 항목은 *(으)로 표시합니다