R Note/문제 해결책2009. 12. 13. 01:02
OS : Snow leopard 10.6.2

문제점
phpinfo() 출력시 다음과 같은 Warning이 발생

Warning: phpinfo() [function.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 'Asia/Seoul' for 'KST/9.0/no DST' instead in /Library/WebServer/Documents/test.php on line 1


해결 방법
해결책은 무척이나 간단했다.
사실 오류 메세지만 보고도 무엇이 잘못되었는지는 알았으나.. 이놈의 php.ini의 위치 때문에 애를 먹었다.
PHP는 Marc Liyang(http://www.entropy.ch/software/macosx/php/#install)에서 Entropy PHP 5.3.0-3.pkg를 다운받아 설치했는데,
여기 설명에 따르면 /usr/local/php5/lib/php.ini 가 존재한다고 한다.

하지만.. 여기에 있는건 가짜였다..ㅡㅡ;
구글링 결과,
/etc/php.ini가 진짜였다. 헐.. 이것때문에 미치는줄 알았음...
어찌되었는.. 나는 /etc엔 php.ini.default만 존재하였는데, 이걸 그냥 php.ini로 변경했다.
그리고 Warning에서 밝힌대로, date.timezone을 다음과 같이 수정했다.

date.timezone = Asia/Seoul

이렇게 수정하고 아파치 서버를 재부팅했더니 깔끔하게 phpinfo()가 출력되었다.

참고
http://www.glenscott.co.uk/2009/08/30/fix-php-timezone-warnings-in-os-x-snow-leopard/
http://us3.php.net/manual/en/timezones.php
Posted by 주인장임