警告:输入中出现意外字符:'\' (ASCII=92) state=0

Warning: Unexpected character in input: '\' (ASCII=92) state=0

我的 php 集成 yii 框架的代码出现以下错误。

Warning: Unexpected character in input: '\' (ASCII=92) state=0 in C:\AppServ\www\edusec\index.php on line 15

Parse error: syntax error, unexpected T_STRING in C:\AppServ\www\edusec\index.php on line 15

代码:

    <?php
    if(!file_exists(__DIR__.'/config/db.php')) {
        header('Location: edusec-requirements.php');
        die;
    }

// comment out the following two lines when deployed to production
defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod');

require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');

$config = require(__DIR__ . '/config/web.php');
$app = new yii\web\Application($config);
$app->run();

我正在使用 Appserv 2.6.0 (Php 6) 开发 Windows 7。

引用自 Whosebug 上的Wiki

PHP 6

On July, 30th, 2014 a majority of the PHP steering group decided to skip version 6 to avoid confusion with an earlier but abandoned PHP 6 project (dubbed the Unicode release). While there never was any official release of PHP 6, many books and articles had been published already.

PHP 6 不存在,永远不会正式存在。它已从版本控制存储库中完全删除。

A​​ppServ 仍然提供对 AppServ 2.6.0 的访问这一事实表明他们完全没有责任感。

PHP最新的官方版本是5.6.13,使用那个官方版本。下一个主要版本(2015 年 11 月左右)将是 PHP 7.... 不会有 PHP 6