data/session 파일중 오래된 것들 삭제하기
세션파일이 보통은 삭제되지만 서버 설정에 따라 오랫동안 삭제안되는경우도 있습니다.
서버를 운영하시는 분은 다음 파일을 php 로 실행하거나
웹호스팅하면 자기 폴더만 지정하시면 되겠네요.
<?php
/* 작성 : howcode.co.kr 김성대 2018-02-03 */
/* 마음대로 퍼가도 됩니다. */
set_time_limit(0);
ini_set('max_execution_time', 300000);
ini_set('mysql.connect_timeout', 90000);
ini_set('mysql.connect_timeout', 90000);
date_default_timezone_set('Asia/Seoul');
if (!isset($config)) $config=array();
$config['show']=false;
//$config['show']=true;
ar_check_dir("/home");
ar_check_dir("/home2");
function ar_check_dir($path) {
global $config;
$handle = @opendir($path);
if (!$handle) return;
//if ($config['show']) echo "path:({$config['ar_count_path']}) $path\n";
if (strstr($path,'/data/session')) {
if ($config['show']) echo "$path\n";
}
while ($file = readdir($handle))
{
$filename=$path.'/'.$file;
if($file == "."||$file == "..") continue;
if (is_dir($filename)) {
ar_check_dir($filename);
}
else if (strstr($path,'/data/session')&&strstr($file,'sess_')) {
ar_check_file($filename);
}
}
closedir($handle);
}
function ar_check_file($filename) {
global $config;
if (strstr($filename,'.php')) {
echo "ERROR : in .php $filename\n";
return;
}
if (!strstr($filename,'sess_')) return;
$t=filemtime($filename);
if ($t<time()-24*3600) {
if ($config['show']) echo "delete $filename ",date("Y-m-d H:i:s",$t),"\n";
@unlink($filename);
}
}
댓글 1개
1ㅡ어디에 어떻게 지정 하라는 건지요 ??
2ㅡ그리고 첨부된 파일을 계정 어느위치치에 올려야 하는지요 ?
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4402 | ||
| 2694 | 2개월 전 | 188 | ||
| 2693 | 2개월 전 | 148 | ||
| 2692 | 2개월 전 | 158 | ||
| 2691 | 2개월 전 | 174 | ||
| 2690 | 2개월 전 | 326 | ||
| 2689 | 2개월 전 | 233 | ||
| 2688 |
|
2개월 전 | 441 | |
| 2687 | 2개월 전 | 292 | ||
| 2686 |
선택과집중
|
2개월 전 | 329 | |
| 2685 | 2개월 전 | 291 | ||
| 2684 | 2개월 전 | 346 | ||
| 2683 | 2개월 전 | 481 | ||
| 2682 | 2개월 전 | 276 | ||
| 2681 | 2개월 전 | 302 | ||
| 2680 |
선택과집중
|
2개월 전 | 278 | |
| 2679 | 2개월 전 | 330 | ||
| 2678 |
|
3개월 전 | 429 | |
| 2677 |
|
3개월 전 | 502 | |
| 2676 | 3개월 전 | 326 | ||
| 2675 | 3개월 전 | 304 | ||
| 2674 |
선택과집중
|
3개월 전 | 480 | |
| 2673 |
|
3개월 전 | 322 | |
| 2672 | 3개월 전 | 335 | ||
| 2671 | 3개월 전 | 284 | ||
| 2670 | 3개월 전 | 260 | ||
| 2669 | 3개월 전 | 374 | ||
| 2668 | 3개월 전 | 289 | ||
| 2667 |
선택과집중
|
3개월 전 | 483 | |
| 2666 |
선택과집중
|
3개월 전 | 470 | |
| 2665 |
선택과집중
|
3개월 전 | 404 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기