본문 바로가기

Projects/Server

제로보드 설치 나 사용시 Warning: Unknown(): 에 대한 에러메세지 처리방법

출처 : http://www.nzeo.com/bbs/zboard.php?id=cgi_tip&page=1&sn1=&divpage=1&sn=off&ss=on&sc=off&keyword=Warning&select_arrange=headnum&desc=asc&no=6297

제로보드 설치시에 나타나는 아래 에러에 대한 해결 방안입니다.

Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3.
Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled.
You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0

원인 : PHP 4.2.0 버전 부터 register_globals 옵션의 설치시 기본값이 On 에서 Off 로 바뀌면서 생기는 문제입니다. 서버상에서 PHP 를 4.2.0 이상의 상위버전으로 재 인스톨 했거나 또는 보안상의 이유로 php.ini 파일에서 register_globals 옵션을 Off 했을 경우 나타나게 됩니다.

해결 : 제로보드 기본디렉토리의 "_head.php"  파일의 제일 상단 부분에 아래의 코드를 삽입

  $_register_globals = (bool) ini_get('register_globals');
  if (!$_register_globals) {
    if (function_exists('ini_set')) {
      ini_set('session.bug_compat_42', 0);
      ini_set('session.bug_compat_warn', 0);
    }
  }

참고 : register_globals 옵션은 변경가능 옵션이 'PHP_INI_PERDIR' 이기 때문에 ini_set() 을 이용해서 변경할 수 없음.
참고 URL : http://www.php.net/manual/en/function.ini-set.php