본문 바로가기

Development/Servers

VSFTP 와 PHP 의 localtime 문제

리눅스 서버에 사용하는 FTP 데몬으로 vsftp 를 사용하고 있는데 파일의 시간정보를 로컬 타임에 맞춰 보내주지 않을 경우가 있다.

서버 시간, PHP 시간 등은 이상이 없는데 FTP 접속해서 보는 파일의 시간만 다르게 보이는 경우는 다음 옵션을 추가하거나 확인해볼 필요가 있다.

48 # If enabled, vsftpd will display directory listings with the time
49 # in your local time zone. The default is to display GMT. The
50 # times returned by the MDTM FTP command are also affected by this
51 # option.
52 use_localtime=YES

세팅하고 vsftpd 리스타트 하면 현재 지역시간에 맞게 정상적으로 보인다.

php 의 경우에는 php.ini 의 [Date] 항목을 살펴볼 필요가 있다.

916 [Date]
917 ; Defines the default timezone used by the date functions
918 ; http://php.net/date.timezone
919 date.timezone = 'Asia/Seoul'

타임존만 세팅해줘도 정상적으로 시간을 출력한다.

'Development > Servers' 카테고리의 다른 글

윈도우에서 nodemon 사용시 팁  (0) 2012.09.20
Ubuntu 1204 LTS Server 셋업  (0) 2012.09.19
cafe24 클라우드 호스팅 셋업  (0) 2012.05.22
*NIX 용 쉘 세팅을 위한  (0) 2011.11.20
CentOS 5 에 NodeJS, MongoDB 설치하기  (2) 2011.07.04