그누보드를 설치한 경로와 다른 경로에 그누보드의 게시판 등을 달려고 하는 방법 아시는 분?

· 2013-10-24 (목) 21:48:33 · 1068 · 3
그누보드를 설치한 디렉토리의 상위 디렉토리에 html 문서를 만들고 거기에 로그인이나 게시판 등을 달려고 해요..
그런데 한가지 문제점이 생겼습니다... 저는 이거 왜 이런지, 어떻게 해야할지 잘 모르겠어요..
누구 아시는 분 있으면 좀 도와주세요..

루트 디렉토리에 index.html 과 _common.php 를 만들었어요.
--------------------------------------------------------------------
_common.php 의 내용은

<?
$G5_PATH = "./gnuboard5"; // common.php 의 상대 경로
include_once("$G5_PATH/common.php");
?>

-------------------------------------------------------------------
그리고 index.html 의 내용은

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?
include_once("./_common.php");
include_once("$G5[path]/head.sub.php");
include_once("$G5[path]/lib/outlogin.lib.php");
include_once("$G5[path]/lib/poll.lib.php");
include_once("$G5[path]/lib/visit.lib.php");
include_once("$G5[path]/lib/connect.lib.php");
include_once("$G5[path]/lib/popular.lib.php");
include_once("$G5[path]/lib/latest.lib.php");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

-------------------------------------------------------------------

그러자 에러메세지가
Cannot modify header information - headers already sent by...
그리고 include_once(/head.sub.php) [function.include-once]: failed to open stream: 그런 파일이나 디렉토리가 없음
이렇게 나와요...
|

댓글 3개

2013-10-24 (목) 22:05:50
위에서 경로를 "$G5[path]/head.sub.php" 이거에서 $G5_PATH/head.sub.php 로 바꾸니까 php 파일들을 참조로 불러오는 건 다 작동을 하게 됐습니다.

저와 비슷한 문제를 겪을 다른 초보 분들을 위해 정리하자면,
그누보드의 게시판 등을 집어넣을 html 문서(그누보드 설치 경로와 다른 곳에 위치한) 와 같은 곳에다가
1. _common.php 파일을 만든다. (파일 이름은 바꿔도 되요. 내용이 중요합니다.) 내용은 아래와 같아요.
<?
$G5_PATH = "./gnuboard5"; // common.php 의 상대 경로.
include_once("$G5_PATH/common.php");
?>

2. 게시판 등을 집어넣을 html 문서의 상단에 아래와 같은 내용을 집어넣는다.
<?
include_once("./phplink.php"); //1번에서 만드는 파일의 이름을 phplink.php 로 했기 때문에...
include_once("$G5_PATH/head.sub.php");
include_once("$G5_PATH/lib/outlogin.lib.php");
include_once("$G5_PATH/lib/poll.lib.php");
include_once("$G5_PATH/lib/visit.lib.php");
include_once("$G5_PATH/lib/connect.lib.php");
include_once("$G5_PATH/lib/popular.lib.php");
include_once("$G5_PATH/lib/latest.lib.php");
?>

head.php 등에서는 경로가
include_once(G5_PATH.'/head.sub.php');
include_once(G5_LIB_PATH.'/latest.lib.php');
include_once(G5_LIB_PATH.'/outlogin.lib.php');
include_once(G5_LIB_PATH.'/poll.lib.php');
include_once(G5_LIB_PATH.'/visit.lib.php');
include_once(G5_LIB_PATH.'/connect.lib.php');
include_once(G5_LIB_PATH.'/popular.lib.php');
이렇게 되어있던데, 이렇게 하면 경로를 못찾더라고요.
2013-10-24 (목) 22:09:52
그리고 위에 경로는 해결됐는데 아래와 같은 오류가 뜨면서 문서에 한글이 깨지는 등의 문제가 생겼습니다.

Warning: Cannot modify header information - headers already sent by (output started at /www/careforaging_net/index.html:2) in /www/careforaging_net/gnuboard5/common.php on line 8

Warning: Cannot modify header information - headers already sent by (output started at /www/careforaging_net/index.html:2) in /www/careforaging_net/gnuboard5/common.php on line 478

Warning: Cannot modify header information - headers already sent by (output started at /www/careforaging_net/index.html:2) in /www/careforaging_net/gnuboard5/common.php on line 480

Warning: Cannot modify header information - headers already sent by (output started at /www/careforaging_net/index.html:2) in /www/careforaging_net/gnuboard5/common.php on line 481

Warning: Cannot modify header information - headers already sent by (output started at /www/careforaging_net/index.html:2) in /www/careforaging_net/gnuboard5/common.php on line 482

Warning: Cannot modify header information - headers already sent by (output started at /www/careforaging_net/index.html:2) in /www/careforaging_net/gnuboard5/common.php on line 483

Warning: Cannot modify header information - headers already sent by (output started at /www/careforaging_net/index.html:2) in /www/careforaging_net/gnuboard5/common.php on line 484

해당 줄을 살펴보니
8번 줄.
header('P3P: CP="ALL CURa ADMa DEVa TAIa OUR BUS IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC OTC"'); // 보안설정이나 프레임이 달라도 쿠키가 통하도록 설정

478번 줄.
header('Content-Type: text/html; charset=utf-8'); // 보안설정이나 프레임이 달라도 쿠키가 통하도록 설정


480~484번 줄.

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/1.0
// 자바스크립트에서 go(-1) 함수를 쓰면 폼값이 사라질때 해당 폼의 상단에 사용하면
// 캐쉬의 내용을 가져옴. 완전한지는 검증되지 않음

이렇더라고요.
이거... 경로문제가 아닌 것 같은데, 어떻게 해야 하는지 아시는 분 계시...겠죠? 도와주세요...
2013-10-24 (목) 22:21:24
아... 근데 위의 방법으로 경로설정을 하니까 이제는 관리자 메뉴로 못들어가네요.
에러 내용은 아래와 같습니다.
Warning: include_once(./gnuboard5/common.php) [function.include-once]: failed to open stream: 그런 파일이나 디렉토리가 없음 in /www/사이트 주소/gnuboard5/adm/_common.php on line 3

Warning: include_once() [function.include]: Failed opening './gnuboard5/common.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /www/사이트 주소/gnuboard5/adm/_common.php on line 3

Warning: include_once(G5_ADMIN_PATH/admin.lib.php) [function.include-once]: failed to open stream: 그런 파일이나 디렉토리가 없음 in /www/사이트 주소/gnuboard5/adm/_common.php on line 4

Warning: include_once() [function.include]: Failed opening 'G5_ADMIN_PATH/admin.lib.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /www/사이트 주소/gnuboard5/adm/_common.php on line 4

기초를 모르고 하려니 여기저기서 엄청 막히네요...

---------------------------
이 문제는 원본 그누보드 파일의 adm/_common.php 와 /_common.php 파일을 복사해서 붙여넣으니 해결됐어요. 이것 저것 하다가 실수로 뭔가를 건드린 모양이에요...
댓글을 작성하시려면 로그인이 필요합니다.

그누5 질답

1,039건

그누보드5 버전에 대한 질문을 할 수 있습니다.쪽지나 메일로 해결해 주겠다는 답변은 정상적인 답변으로 보기 어려우므로 신고해 주시기 바랍니다.

+
제목 글쓴이 날짜 조회
13-10-25 조회 526
13-10-25 조회 505
13-10-25 조회 1,471
13-10-25 조회 716
13-10-25 조회 491
13-10-24 조회 1,069
13-10-24 조회 1,178
13-10-24 조회 760
13-10-24 조회 679
13-10-24 조회 1,016
13-10-23 조회 821
13-10-23 조회 1,011
13-10-23 조회 884
13-10-23 조회 686
13-10-23 조회 469
13-10-23 조회 725
13-10-22 조회 500
13-10-22 조회 440
13-10-22 조회 683
13-10-22 조회 577