2015-09-26 198 views
-3

我的整合yii框架的php代码出现以下错误。警告:输入中意外的字符:''(ASCII = 92)状态= 0

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(); 

我工作在Windows 7的appserv 2.6.0(PHP 6)。

+3

__PHP6?!?__ ___认真吗?___ PHP6从来没有正式存在过,永远不会!我强烈建议丢弃它并转而使用支持的PHP版本。 –

+1

Appserv - 如果他们有任何责任感,将停止将PHP6下载公开发布。 –

回答

8

从这里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不存在,而且永远不会正式存在。它完全从版本控制库中删除。

AppServ仍然提供对AppServ 2.6.0的访问的事实表明他们完全没有责任。

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

+0

感谢wiki。我已经用5.4替换php 6,并在配置文件中进行必要的更改。现在它的工作。再次感谢 –