영카트설치시에 뜨는 에러가 왜 생기는지 모르겠습니다
본문
영카트를 다 설치하고 mysql디비지정까지 한후 들어가니
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION
or T_FUNCTION or T_VAR or '}' in
/free/home/mbcidc128/html/shop_gnu5/lib/common.lib.php on line
2350
이런 내용이 뜨면서 더 이상 진행이 안되는군요
왜 그럴까요?
common.lib.php 의 2350 line은 아래와 같습니다(그대로복사한 내용입니다)
2349 class html_process {
2350 protected $css = array();
protected $js = array();
function merge_stylesheet($stylesheet, $order)
{
$links = $this->css;
$is_merge = true;
foreach($links as $link) {
if($link[1] == $stylesheet) {
$is_merge = false;
break;
}
}
if($is_merge)
$this->css[] = array($order, $stylesheet);
}
function merge_javascript($javascript, $order)
{
$scripts = $this->js;
$is_merge = true;
foreach($scripts as $script) {
if($script[1] == $javascript) {
$is_merge = false;
break;
}
}
if($is_merge)
$this->js[] = array($order, $javascript);
}
function run()
{
global $config, $g5, $member;
// 현재접속자 처리
$tmp_sql = " select count(*) as cnt from {$g5['login_table']} where lo_ip = '{$_SERVER['REMOTE_ADDR']}' ";
$tmp_row = sql_fetch($tmp_sql);
if ($tmp_row['cnt']) {
$tmp_sql = " update {$g5['login_table']} set mb_id = '{$member['mb_id']}', lo_datetime = '".G5_TIME_YMDHIS."', lo_location = '{$g5['lo_location']}', lo_url = '{$g5['lo_url']}' where lo_ip = '{$_SERVER['REMOTE_ADDR']}' ";
sql_query($tmp_sql, FALSE);
} else {
$tmp_sql = " insert into {$g5['login_table']} ( lo_ip, mb_id, lo_datetime, lo_location, lo_url ) values ( '{$_SERVER['REMOTE_ADDR']}', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$g5['lo_location']}', '{$g5['lo_url']}' ) ";
sql_query($tmp_sql, FALSE);
// 시간이 지난 접속은 삭제한다
sql_query(" delete from {$g5['login_table']} where lo_datetime < '".date("Y-m-d H:i:s", G5_SERVER_TIME - (60 * $config['cf_login_minutes']))."' ");
// 부담(overhead)이 있다면 테이블 최적화
//$row = sql_fetch(" SHOW TABLE STATUS FROM `$mysql_db` LIKE '$g5['login_table']' ");
//if ($row['Data_free'] > 0) sql_query(" OPTIMIZE TABLE $g5['login_table'] ");
}
$buffer = ob_get_contents();
ob_end_clean();
$stylesheet = '';
$links = $this->css;
if(!empty($links)) {
foreach ($links as $key => $row) {
$order[$key] = $row[0];
$index[$key] = $key;
$style[$key] = $row[1];
}
array_multisort($order, SORT_ASC, $index, SORT_ASC, $links);
foreach($links as $link) {
if(!trim($link[1]))
continue;
$link[1] = preg_replace('#\.css([\'\"]?>)$#i', '.css?ver='.G5_CSS_VER.'$1', $link[1]);
$stylesheet .= PHP_EOL.$link[1];
}
}
$javascript = '';
$scripts = $this->js;
$php_eol = '';
unset($order);
unset($index);
if(!empty($scripts)) {
foreach ($scripts as $key => $row) {
$order[$key] = $row[0];
$index[$key] = $key;
$script[$key] = $row[1];
}
array_multisort($order, SORT_ASC, $index, SORT_ASC, $scripts);
foreach($scripts as $js) {
if(!trim($js[1]))
continue;
$js[1] = preg_replace('#\.js([\'\"]?>)$#i', '.js?ver='.G5_JS_VER.'$1', $js[1]);
$javascript .= $php_eol.$js[1];
$php_eol = PHP_EOL;
}
}
/*
</title>
<link rel="stylesheet" href="default.css">
밑으로 스킨의 스타일시트가 위치하도록 하게 한다.
*/
$buffer = preg_replace('#(</title>[^<]*<link[^>]+>)#', "$1$stylesheet", $buffer);
/*
</head>
<body>
전에 스킨의 자바스크립트가 위치하도록 하게 한다.
*/
$nl = '';
if($javascript)
$nl = "\n";
$buffer = preg_replace('#(</head>[^<]*<body[^>]*>)#', "$javascript{$nl}$1", $buffer);
return $buffer;
}
}
답변 2
동일한 질문이네요. 서버 php 버전 체크하세요.
상세 이유는 이렇다고 하네요. 윗 글에 나와있습니다.
"class 내에서 사용되는 protected 키워드가 php 4.x대에서는 지원 자체가 안 되는 거라서 그렇습니다."
- PHP 5.0 이상
- MySQL 5.0 이상 or MySQL 5.0 이상의 기능을 만족하는 mariaDB
- 리눅스 호환 OS
버젼 오류같네요
php버젼 체크하세여