창피한 질문하나... ㅠ..ㅠ 정보
창피한 질문하나... ㅠ..ㅠ본문
잘 되던거를 추가수정하다가 오류가 나오는데... 원인을 못 찾겠어요. ㅠ..ㅠ
해당 파일을 cache_notice.inc.php로 만들어서 /preload 디렉토리에 업로드 하면 됩니다.
/preload/cache 디렉토리를 만들어서 권한을 707로 주면 그곳에 캐쉬 파일이 생깁니다.
아~ 오류가 뭐냐구요? 넘 챙피해서 ㅠ..ㅠ
Warning: include_once(/common.php) [function.include-once]: failed to open stream: No such file or directory in /home/pitt/public_html/preload/cache_notice.inc.php on line 2
Warning: include_once() [function.include]: Failed opening '/common.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /home/pitt/public_html/preload/cache_notice.inc.php on line 2
Fatal error: Call to undefined function sql_fetch() in /home/pitt/public_html/preload/cache_notice.inc.php on line 6
Warning: include_once() [function.include]: Failed opening '/common.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /home/pitt/public_html/preload/cache_notice.inc.php on line 2
Fatal error: Call to undefined function sql_fetch() in /home/pitt/public_html/preload/cache_notice.inc.php on line 6
<?
$g4_path = "..";
include_once("$g4_path/common.php");
$g4_path = "..";
include_once("$g4_path/common.php");
// scrap 테이블 마지막 업데이트 일시 가져오기
$sql = "SHOW TABLE STATUS FROM $mysql_db WHERE name = '$g4[scrap_table]'";
$result = sql_fetch($sql);
$table_update_ut = strtotime($result['Update_time']);
$sql = "SHOW TABLE STATUS FROM $mysql_db WHERE name = '$g4[scrap_table]'";
$result = sql_fetch($sql);
$table_update_ut = strtotime($result['Update_time']);
// 파일 수정 일시 가져오기
$file_modify_ut = @filemtime("./notice.cache.php");
$file_modify_ut = @filemtime("./notice.cache.php");
?>
<!-- Table Update Unixtime : <?=$table_update_ut?> -->
<!-- File Modify Unixtime : <?=$file_modify_ut?> -->
<!-- File Modify Unixtime : <?=$file_modify_ut?> -->
<?
//// 운영자 스크랩 리스트 표시해주는 함수
function show_scrap_list($user_id, $skin_dir, $title, $limit_count=10)
{
global $g4;
//// 운영자 스크랩 리스트 표시해주는 함수
function show_scrap_list($user_id, $skin_dir, $title, $limit_count=10)
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
// 게시판 제목 설정
$board['bo_subject'] = $title;
$board['bo_subject'] = $title;
$query = "SELECT SC.bo_table, SC.wr_id FROM g4_scrap SC ";
$query .= "WHERE mb_id='".$user_id."' ";
$query .= "ORDER BY ms_id DESC ";
$query .= "LIMIT ".$limit_count;
$sql = mysql_query($query);
$query .= "WHERE mb_id='".$user_id."' ";
$query .= "ORDER BY ms_id DESC ";
$query .= "LIMIT ".$limit_count;
$sql = mysql_query($query);
$i = 0;
while( $s_row = mysql_fetch_array($sql) )
{
$query = "SELECT * FROM `g4_write_".$s_row['bo_table']."` WHERE wr_id='".$s_row['wr_id']."'";
$w_row = mysql_fetch_array(mysql_query($query));
while( $s_row = mysql_fetch_array($sql) )
{
$query = "SELECT * FROM `g4_write_".$s_row['bo_table']."` WHERE wr_id='".$s_row['wr_id']."'";
$w_row = mysql_fetch_array(mysql_query($query));
$list[$i]['subject'] = cut_str($w_row['wr_subject'], 60);
$list[$i]['href'] = $g4['bbs_path']."/board.php?bo_table=".$s_row['bo_table']."&wr_id=".$s_row['wr_id'];
$list[$i]['href'] = $g4['bbs_path']."/board.php?bo_table=".$s_row['bo_table']."&wr_id=".$s_row['wr_id'];
// 날짜 표시하기
$list[$i]['datetime'] = substr($w_row['wr_datetime'],0,10);
$list[$i]['datetime2'] = $w_row['wr_datetime'];
// 당일인 경우 시간으로 표시함
if ($list[$i]['datetime'] == $g4['time_ymd'])
$list[$i]['datetime2'] = substr($list[$i]['datetime2'],11,5);
else
$list[$i]['datetime2'] = substr($list[$i]['datetime2'],5,5);
$list[$i]['datetime'] = substr($w_row['wr_datetime'],0,10);
$list[$i]['datetime2'] = $w_row['wr_datetime'];
// 당일인 경우 시간으로 표시함
if ($list[$i]['datetime'] == $g4['time_ymd'])
$list[$i]['datetime2'] = substr($list[$i]['datetime2'],11,5);
else
$list[$i]['datetime2'] = substr($list[$i]['datetime2'],5,5);
$i++;
}
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
}
?>
<?
$filename_ch = "./cache/notice.cache.php";
$filename_ch = "./cache/notice.cache.php";
echo $table_update_ut;
echo "--";
echo $file_modify_ut;
echo "--";
echo $table_update_ut - $file_modify_ut;
echo "--";
echo $file_modify_ut;
echo "--";
echo $table_update_ut - $file_modify_ut;
//if( $table_update_ut > $file_modify_ut) // 파일 업데이트 이후에 DB가 변경되었을 때
{
// 페이징 캐쉬 스크립트
ob_start();
{
// 페이징 캐쉬 스크립트
ob_start();
echo show_scrap_list("admin", "basic", "Notice...", 8);
$cache_out = ob_get_clean();
// 파일이 없는 경우 파일을 생성
if ( !file_exists($filename_ch ) ) {
fclose( fopen($filename_ch, "w") );
}
// 파일이 없는 경우 파일을 생성
if ( !file_exists($filename_ch ) ) {
fclose( fopen($filename_ch, "w") );
}
// 파일에 저장
$fp = fopen("$filename_ch", "w");
fwrite($fp, $cache_out);
fclose($fp);
}
$fp = fopen("$filename_ch", "w");
fwrite($fp, $cache_out);
fclose($fp);
}
require_once("$filename_ch");
?>
?>
댓글 전체
/home/pitt/public_html/ 여기 common.php 가 있나요? ㅡ0ㅡ?
예... 당연히 있어요. ㅠ..ㅠ
그누의 root 설치 디렉토리에요.
다시 testing을 해보니까 /preload/cache_notice.inc.php를 단독으로 돌리는 것은 잘 되는데
/home.php에... 다음과 같이 하니까 오류가 주르륵 ㅠ..ㅠ
<? include_once("./preload/cache_notice.inc.php")?>
그래서, cache_notice.inc.php를 /cache_notice.inc.php 로 위치를 바꾸니까 오류가 없네요. ㅠ..ㅠ
저는 cache_notice.inc.php를 preload 디렉토리에 두고 싶은데... 도대체 뭐가 문제인가요??
그누의 root 설치 디렉토리에요.
다시 testing을 해보니까 /preload/cache_notice.inc.php를 단독으로 돌리는 것은 잘 되는데
/home.php에... 다음과 같이 하니까 오류가 주르륵 ㅠ..ㅠ
<? include_once("./preload/cache_notice.inc.php")?>
그래서, cache_notice.inc.php를 /cache_notice.inc.php 로 위치를 바꾸니까 오류가 없네요. ㅠ..ㅠ
저는 cache_notice.inc.php를 preload 디렉토리에 두고 싶은데... 도대체 뭐가 문제인가요??
저는 위 내용 저장해서 구누설치된 폴더(루트)에 preload 만들어 업로드 하고 호출해도
Warning: include_once(/common.php) [function.include-once]: failed to open stream: No such file or directory in /home/pitt/public_html/preload/cache_notice.inc.php on line 2
Warning: include_once() [function.include]: Failed opening '/common.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /home/pitt/public_html/preload/cache_notice.inc.php on line 2
Fatal error: Call to undefined function sql_fetch() in /home/pitt/public_html/preload/cache_notice.inc.php on line 6
위 에러 안뜨는데요 -_-;; 위 에러는 아시겠지만 파일 또는 경로가 잘못되서 함수 호출을 못하는건데...
모르겠네요 ㄷ ㄷ ㄷ
Warning: include_once(/common.php) [function.include-once]: failed to open stream: No such file or directory in /home/pitt/public_html/preload/cache_notice.inc.php on line 2
Warning: include_once() [function.include]: Failed opening '/common.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /home/pitt/public_html/preload/cache_notice.inc.php on line 2
Fatal error: Call to undefined function sql_fetch() in /home/pitt/public_html/preload/cache_notice.inc.php on line 6
위 에러 안뜨는데요 -_-;; 위 에러는 아시겠지만 파일 또는 경로가 잘못되서 함수 호출을 못하는건데...
모르겠네요 ㄷ ㄷ ㄷ
home.php 에서 /preload/cache_notice.inc.php 를 include 하시는거죠?
그러면 cache_notice.inc.php 의 $g4_path 를
$g4_path = "."; 로 해보세요.
그러면 cache_notice.inc.php 의 $g4_path 를
$g4_path = "."; 로 해보세요.
home.php에서 cache_notice.inc.php를 include하면서 프로그램 내부의 경로가 다 이상해졌어요. ㅠ..ㅠ
아래 경로를
$filename_ch = "./cache/notice.cache.php";
불필요한 include인 common.php를 지우고 아래를 절대 경로로 변경했더니 되더라구요.
$filename_ch = "$g4[path]/preload/cache/notice.cache.php";
페이지 캐쉬는 내일 정리해서 편하게 쓸 수 있게 재구성해서 올릴 예쩡입니다.
아래 경로를
$filename_ch = "./cache/notice.cache.php";
불필요한 include인 common.php를 지우고 아래를 절대 경로로 변경했더니 되더라구요.
$filename_ch = "$g4[path]/preload/cache/notice.cache.php";
페이지 캐쉬는 내일 정리해서 편하게 쓸 수 있게 재구성해서 올릴 예쩡입니다.