extend.lib.php와 head.sub.php 에러 ㅠㅠ 정보
extend.lib.php와 head.sub.php 에러 ㅠㅠ본문
홈페이지 상단에 아래와 같은 에러가 뜨네요. 근데 그 밑으로 홈피 레이아웃은 정상적으로 뜹니다. 원인이 뭐죠?? -_-;;;;;;
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/urimanse/www/extend/extend.lib.php:1) in /home/hosting_users/urimanse/www/head.sub.php on line 33
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/urimanse/www/extend/extend.lib.php:1) in /home/hosting_users/urimanse/www/head.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/urimanse/www/extend/extend.lib.php:1) in /home/hosting_users/urimanse/www/head.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/urimanse/www/extend/extend.lib.php:1) in /home/hosting_users/urimanse/www/head.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/urimanse/www/extend/extend.lib.php:1) in /home/hosting_users/urimanse/www/head.sub.php on line 38
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/urimanse/www/extend/extend.lib.php:1) in /home/hosting_users/urimanse/www/head.sub.php on line 39
에러구문에 나오는 head.sub.php의 소스는 아래입니다. 우선은 주석처리하니까 레이아웃은 깨지지 않는데 로그인/로그아웃/글쓰기 등에서 페이지 전환시 잠시 에러페이지가 떴다가 사라지네요.ㅠㅠ
header("Content-Type: text/html; charset=$g4[charset]");
$gmnow = gmdate("D, d M Y H:i:s") . " GMT";
header("Expires: 0"); // rfc2616 - Section 14.21
header("Last-Modified: " . $gmnow);
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: pre-check=0, post-check=0, max-age=0"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/.0
회사컴으로 작업을 하다가 오늘 낮부터 갑자기 이러네요. 회사컴에 아크로에디터를 깔았는데 utf-8 설정이 안되는지 한글이 ㅁ으로 깨져서 나왔는데 그래도 무시하고 계속 작업을 하다보니 이렇게 되었습니다.
웹상에서는 한글이 정상적으로 나왔습니다.
이거 원인이 뭘까요ㅜㅜ
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/urimanse/www/extend/extend.lib.php:1) in /home/hosting_users/urimanse/www/head.sub.php on line 33
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/urimanse/www/extend/extend.lib.php:1) in /home/hosting_users/urimanse/www/head.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/urimanse/www/extend/extend.lib.php:1) in /home/hosting_users/urimanse/www/head.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/urimanse/www/extend/extend.lib.php:1) in /home/hosting_users/urimanse/www/head.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/urimanse/www/extend/extend.lib.php:1) in /home/hosting_users/urimanse/www/head.sub.php on line 38
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/urimanse/www/extend/extend.lib.php:1) in /home/hosting_users/urimanse/www/head.sub.php on line 39
에러구문에 나오는 head.sub.php의 소스는 아래입니다. 우선은 주석처리하니까 레이아웃은 깨지지 않는데 로그인/로그아웃/글쓰기 등에서 페이지 전환시 잠시 에러페이지가 떴다가 사라지네요.ㅠㅠ
header("Content-Type: text/html; charset=$g4[charset]");
$gmnow = gmdate("D, d M Y H:i:s") . " GMT";
header("Expires: 0"); // rfc2616 - Section 14.21
header("Last-Modified: " . $gmnow);
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: pre-check=0, post-check=0, max-age=0"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/.0
회사컴으로 작업을 하다가 오늘 낮부터 갑자기 이러네요. 회사컴에 아크로에디터를 깔았는데 utf-8 설정이 안되는지 한글이 ㅁ으로 깨져서 나왔는데 그래도 무시하고 계속 작업을 하다보니 이렇게 되었습니다.
웹상에서는 한글이 정상적으로 나왔습니다.
이거 원인이 뭘까요ㅜㅜ
댓글 전체

extend.lib.php 이파일도 정검 해보셨나요?
당연히 했죠. 근데 원인을 모르겠네요...;;

header() 함수를 사용하기 전에 그 어떤 출력(공백/엔터/HTML등)도 선행되어서는 안됩니다.
PHP4 이상의 output buffering 기능 사용하기.
http://l2zeo.com/it/210?category=22
PHP4 이상의 output buffering 기능 사용하기.
http://l2zeo.com/it/210?category=22
extend.lib.php 파일에 BOM(Byte Order Mark)이 있어서 그렇습니다.
BOM을 출력으로 보내는 바람에 head.sub.php의 header()함수에서 에러가 발생합니다.
에디트플러스로 extend.lib.php 파일을 열고 새이름으로 저장할 때 인코딩을 UTF-8로 선택해 주시면 BOM이 제거됩니다.
메모장은 UTF-8로 파일 저장시 BOM을 자동으로 삽입합니다.
BOM을 출력으로 보내는 바람에 head.sub.php의 header()함수에서 에러가 발생합니다.
에디트플러스로 extend.lib.php 파일을 열고 새이름으로 저장할 때 인코딩을 UTF-8로 선택해 주시면 BOM이 제거됩니다.
메모장은 UTF-8로 파일 저장시 BOM을 자동으로 삽입합니다.
감사합니다^^ 제대로 처리된거 같네요.