경로 헬프미 입니다. 정말 안되네요 ㅜㅜ > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

경로 헬프미 입니다. 정말 안되네요 ㅜㅜ 정보

경로 헬프미 입니다. 정말 안되네요 ㅜㅜ

본문

현재 사용할 파일이 하위 폴더 include/sub_1_1.php라는 파일인데  이 파일 최상단에 아래와 같이 경로를 넣어 줬습니다.(구누보고서 함)
<?
$g4_path = "..";
include_once("$g4_path/common.php");
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/outlogin.lib.php");
include_once("$g4[path]/lib/poll.lib.php");
include_once("$g4[path]/lib/visit.lib.php");
include_once("$g4[path]/lib/connect.lib.php");
include_once("$g4[path]/lib/popular.lib.php");

//print_r2(get_defined_constants());

// 사용자 화면 상단과 좌측을 담당하는 페이지입니다.
// 상단, 좌측 화면을 꾸미려면 이 파일을 수정합니다.

$table_width = 1004;
?>
문제는 파일을 열면 include_once("$g4_path/common.php"); 인식못한다면서

Warning: include_once(/../common.php) [function.include-once]: failed to open stream: No such file or directory in /home/hosting_users/sosp/www/include/sub_3_1_a.php on line 3

Warning: include_once() [function.include]: Failed opening '/../common.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/hosting_users/sosp/www/include/sub_3_1_a.php on line 3 나옵니다.

미치겠습니다  고수님의 간절한 도움 좀
같은 경오에서는 이상 없는데 하위 경오를 만들고 넣으면 안되네요
초보라 그런지 .....
 그리고 그누보드에서 <html><body></body></html> 코드를 안써도 이상 없나요?
sub_1_1.php의 전체 소스 입니다.
아래는 전체 파일
<?
$g4_path = "..";
include_once("$g4_path/common.php");
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/outlogin.lib.php");
include_once("$g4[path]/lib/poll.lib.php");
include_once("$g4[path]/lib/visit.lib.php");
include_once("$g4[path]/lib/connect.lib.php");
include_once("$g4[path]/lib/popular.lib.php");

//print_r2(get_defined_constants());

// 사용자 화면 상단과 좌측을 담당하는 페이지입니다.
// 상단, 좌측 화면을 꾸미려면 이 파일을 수정합니다.

$table_width = 1004;
?>

<!-- 상단 배경 시작 -->
<table width="<?=$table_width?>" cellspacing="0" cellpadding="0">
<tr>
    <td background="<?=$g4['../path']?>/img/top_img_bg.gif">
        <table width="100%" height="52" cellspacing="0" cellpadding="0">
        <tr>
            <td><img src="<?=$g4['../path']?>/img/top_img.gif" width="100%" height="52"></td>
        </tr>
        </table></td>
</tr>
</table>
<!-- 상단 배경 끝 -->

<!-- 상단 로고 및 버튼 시작 -->
<table width="<?=$table_width?>" cellspacing="0" cellpadding="0">
<tr>
    <td width="43" height="57"></td>
    <!-- 로고 -->
    <td width="220"><a href="<?=$g4['../path']?>/"><img src="<?=$g4['../path']?>/img/logo.jpg" width="220" height="57" border="0"></a></td>
    <td>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td>&nbsp;</td>
        </tr>
        </table>
    </td>
    <td width="390" align="right">
        <table border="0" cellspacing="0" cellpadding="0">
        <tr>
            <!-- 처음으로 버튼 -->
            <td width="78"><a href="<?=$g4['../path']?>/"><img src="<?=$g4['../path']?>/img/top_m01.gif" width="78" height="31" border="0"></a></td>

            <? if (!$member['mb_id']) { ?>
            <!-- 로그인 이전 -->
            <td width="78"><a href="<?=$g4['../bbs_path']?>/login.php?url=<?=$urlencode?>"><img src="<?=$g4['../path']?>/img/top_m02.gif" width="78" height="31" border="0"></a></td>
            <td width="78"><a href="<?=$g4['../bbs_path']?>/register.php"><img src="<?=$g4['../path']?>/img/top_m03.gif" width="78" height="31" border="0"></a></td>
            <? } else { ?>
            <!-- 로그인 이후 -->
            <td width="78"><a href="<?=$g4['../bbs_path']?>/logout.php"><img src="<?=$g4['../path']?>/img/top_m04.gif" width="78" height="31" border="0"></a></td>
            <td width="78"><a href="<?=$g4['../bbs_path']?>/member_confirm.php?url=register_form.php"><img src="<?=$g4['../path']?>/img/top_m05.gif" width="78" height="31" border="0"></a></td>
            <? } ?>

            <!-- 최근게시물 버튼 -->
            <td width="78"><a href="<?=$g4['../bbs_path']?>/new.php"><img src="<?=$g4['../path']?>/img/top_m06.gif" width="78" height="31" border="0"></a></td>

        </tr>
        </table></td>
    <td width="35"></td>
</tr>
</table>
<!-- 상단 로고 및 버튼 끝 -->

<!-- 검색 시작 -->
<table width="<?=$table_width?>" cellspacing="0" cellpadding="0">
<tr>
    <td width="43" height="11"></td>
    <td width="220"></td>
    <td width=""></td>
    <td width="234"><img src="<?=$g4['../path']?>/img/search_top.gif" width="234" height="11"></td>
    <td width="35"></td>
</tr>
<tr>
    <td height="33"><img src="<?=$g4['../path']?>/img/bar_01.gif" width="43" height="33"></td>
    <td><img src="<?=$g4['../path']?>/img/bar_02.gif" width="220" height="33"></td>
    <td background="<?=$g4['../path']?>/img/bar_03.gif" width="472" height="33"><table width=100% cellpadding=0 cellspacing=0><tr><td width=25>&nbsp;</td><td><?//=popular();?></td></tr></table></td>
    <td>
        <form name="fsearchbox" method="get" onsubmit="return fsearchbox_submit(this);" style="margin:0px;">
        <!-- <input type="hidden" name="sfl" value="concat(wr_subject,wr_content)"> -->
        <input type="hidden" name="sfl" value="wr_subject||wr_content">
        <input type="hidden" name="sop" value="and">
        <table width="100%" height="33" cellspacing="0" cellpadding="0">
        <tr>
            <td width="25" height="25"><img src="<?=$g4['../path']?>/img/search_01.gif" width="25" height="25"></td>
            <td width="136" valign="middle" bgcolor="#F4F4F4"><INPUT name="stx" type="text" style="BORDER : 0px solid; width: 125px; HEIGHT: 20px; BACKGROUND-COLOR: #F4F4F4" maxlength="20"></td>
            <td width="12"><img src="<?=$g4['../path']?>/img/search_02.gif" width="12" height="25"></td>
            <td width="48"><input type="image" src="<?=$g4['../path']?>/img/search_button.gif" width="48" height="25" border="0"></td>
            <td width="13"><img src="<?=$g4['../path']?>/img/search_03.gif" width="13" height="25"></td>
        </tr>
        <tr>
            <td width="234" height="8" colspan="5"><img src="<?=$g4['../path']?>/img/search_down.gif" width="234" height="8"></td>
        </tr>
        </table>
        </form>
    </td>
    <td></td>
</tr>
</table>

<script type="text/javascript">
function fsearchbox_submit(f)
{
    if (f.stx.value.length < 2) {
        alert("검색어는 두글자 이상 입력하십시오.");
        f.stx.select();
        f.stx.focus();
        return false;
    }

    // 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
    var cnt = 0;
    for (var i=0; i<f.stx.value.length; i++) {
        if (f.stx.value.charAt(i) == ' ')
            cnt++;
    }

    if (cnt > 1) {
        alert("빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다.");
        f.stx.select();
        f.stx.focus();
        return false;
    }

    f.action = "<?=$g4['bbs_path']?>/search.php";
    return true;
}
</script>
<!-- 검색 끝 -->

<div style='height:18px;'></div>

<table width='<?=$table_width?>' cellpadding=0 cellspacing=0 border=0>
<tr>
    <td width=43></td>
    <!-- 왼쪽 메뉴 -->
    <td width=220 valign=top>
        <?=outlogin("basic"); // 외부 로그인 ?>

        <div style='height:10px;'></div>

        <?=poll("basic"); // 설문조사 ?>

        <div style='height:10px;'></div>

        <?=visit("basic"); // 방문자수 ?>

        <div style='height:10px;'></div>

        <?=connect(); // 현재 접속자수 ?>
    </td>
    <td width=18></td>
    <!-- 중간 -->
    <td width=683 valign=top>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

// 사용자 화면 우측과 하단을 담당하는 페이지입니다.
// 우측, 하단 화면을 꾸미려면 이 파일을 수정합니다.
?>

</td>
<td width=40></td>
</tr></table>

<!-- 카피라이트 시작 -->
<table width="<?=$table_width?>" border="0" cellspacing="10" cellpadding="10">
<tr>
    <td valign="top" background="<?=$g4['../path']?>/img/copyright.gif"><a href="#g4_head"><img src="<?=$g4['../path']?>/img/icon.gif" width="15" height="12" border="0"></a><font color="#848484">Copyright ⓒ your-domain. All rights reserved.</font></td>
</tr>
</table>
<!-- 카피라이트 끝 -->

<?
include_once("../$g4[path]/tail.sub.php");
?>

댓글 전체

그누보드는 루트에 설치하셨나요?
그누 루트에 설치된 상태에선 이상없이 나타나는데요.
맨 아래 tail만... 이렇게 바꾸니까...
<?
include_once("$g4[path]/tail.sub.php");
?>

common.php 위치를 다시 확인해 보세요.
sub_1_1.php 를 링크로 호풀하느냐 include로 불러오느냐에 따라 경로 지정법이 다릅니다
 sub_1_1.php를 인클루드 한다면 인클루드하는 화일에서 경로등을 설정하면 되는데....
인클루드 당하는 화일을 별개로 생각하지말고  인클루드하는 화일이라고 생각하고 경로를 설정해야 합니다
<html><body></body></html>는
head.sub.php와 tail.sub.php파일에서 정의되어있습니다.

원본그누보드의 경우 head.sub.php → _head.php → head.php 이런식으로 불러옵니다.
하단에도 마찬가지로 tail.php → _tail.php → tail.sib.php 입니다.
<?=$g4['../path']?> <?=$g4['path']?>로 바꿔주셔야 할것같구요

참고로 경로에 관한 팁란이 글이 있어서 올려드립니다. 읽어보시면 문제 해결에 도움이 될듯하네요

g4 파일마다 들어있는 $g4_path, _common.php 설정 및 사용법입니다
g4 설치 디렉토리와 내가 작업하는 디렉토리의 구조에 따라서 $g4_path의 설정을 너무 어려워들 하시는것 같아 정리를 한답시고 해봤는데...
설명이 더어려울 수도 있겠군요.
잘 이해 되지 않거나 혼란스러운것은 잊어버리시고 아래쪽에 있는 "자주하시는 질문"을 숙지 하시기 바랍니다.

1. 관리자님께서 권장하시는 "_common.php" 를 사용할경우
  1) 작업할 현재 디렉토리에 받드시 "_common.php" 가 있어야 함
  2) _common.php의 내용은 다음과 같아야 하는데 $g4_path는 3)을 참고하여 설정한다.
        <?
        $g4_path = ".";        // 이곳의 설정은 아래쪽의 3) 부분을 참고
        include_once("$g4_path/common.php");
        ?>

  3) _common.php에서 $g4_path 의 설정방법(현재 작업 디렉토리에서 그누보드가 설치된 상대경로를 설정한다)
        $g4_path = ".";        // 현재 디렉토리에 그누보드가 설치된경우, 그누보드 설치 디렉토리에 있는 파일 참조
        $g4_path = "..";        // 상위 디렉토리에 그누보드가 설치된경우
        $g4_path = "../..";    // 상위, 상위 디렉토리에 그누보드가 설치된경우
        $g4_path = "gnuboard4"; // 하위 디렉토리 gnuboard4에 그누보드가 설치된경우
        $g4_path = "board/g4";  // 하위 board 디렉토리의 하위 디렉토리 g4에 그누보드가 설치된경우
        $g4_path = "../g4";    // 그누보드가 내가 작업할 디렉토리와 같은 레벨의 디렉토리(g4)에 설치된경우
                       
2. _common.php 를 사용하지 않을경우
  생성하는 php 파일마다 위의  2)의 내용을 추가하시고
  $g4_path 부분은 위의 3)을 참고하시어 설정하시면 됩니다.
전체 66,558 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT