2016-06-17 5 views
-4

"/ core/session/manager-> start();"という行にエラーが発生しました。構文解析エラー:予期しない行728の '/'

このエラーの解決方法をお伝えください。

// Start session and prepare global $SESSION, $USER. 
if (empty($CFG->sessiontimeout)) { 
    $CFG->sessiontimeout = 7200; 
} 
/core/session/manager->start(); 

// Set default content type and encoding, developers are still required to use 
// echo $OUTPUT->header() everywhere, anything that gets set later should override these headers. 
// This is intended to mitigate some security problems. 
if (AJAX_SCRIPT) { 
    if (!core_useragent->supports_json_contenttype()) { 
     // Some bloody old IE. 
     @header('Content-type: text/plain; charset=utf-8'); 
     @header('X-Content-Type-Options: nosniff'); 
    } else if (!empty($_FILES)) { 
     // Some ajax code may have problems with json and file uploads. 
     @header('Content-type: text/plain; charset=utf-8'); 
    } else { 
     @header('Content-type: application/json; charset=utf-8'); 
    } 
} else if (!CLI_SCRIPT) { 
    @header('Content-type: text/html; charset=utf-8'); 
} 
+0

それはおそらくよりは、ライン上で不足しているセミコロンです。 –

+4

[PHP Parse/Syntax Errors]の重複可能性があります。どのようにそれらを解決するには?](http://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them) –

+0

@GarryWeldingは、上記の行の後にコードを見つけてください質問で if(空($ CFG-> sessiontimeout)){ $ CFG-> sessiontimeout = 7200; } /core/session/manager-> start(); if(AJAX_SCRIPT){ if(!core_useragent-> supports_json_contenttype()){ //一部の古いIEです。 @header( 'コンテンツタイプ:text/plain; charset = utf-8'); @header( 'X-Content-Type-Options:nosniff'); } – naresh

答えて

0

名前空間の概念は、PHPバージョン(PHP 5> = 5.3.0、PHP 7)と互換性があります。 PHPのバージョンに問題がある可能性があります。あなたのPHPのバージョンを確認してください。

0

PHP namespacesシンタックスでは、バックスラッシュが使用されます。

エラーを修正するには、交換してください:

/core/session/manager->start(); 

で:多くのコードなしで、それは難しいのですが、教えて前に...

\core\session\manager->start(); 
関連する問題