zf-tutorial致命错误

时间:2011-10-05 14:41:41

标签: zend-framework

我从zend开始,使用zf-tutorial(CD应用程序),但我收到了:

! )致命错误:未捕获异常'Zend_Config_Exception',消息'语法错误,意外$结束,期待TC_DOLLAR_CURLY或TC_QUOTED_STRING或':'在C:\ wamp \ www \ zf-tutorial \ library \ Zend \ Config \ Ini.php上线182 (!)Zend_Config_Exception:语法错误,意外的$ end,在C:\ wamp \ www \的第29行的C:\ wamp \ www \ zf-tutorial \ application / configs / application.ini中期待TC_DOLLAR_CURLY或TC_QUOTED_STRING或'“'第182行的zf-tutorial \ library \ Zend \ Config \ Ini.php

我查了一下Ini.php 182:

protected function _parseIniFile($filename)
{
    set_error_handler(array($this, '_loadFileErrorHandler'));
    $iniArray = parse_ini_file($filename, true); // Warnings and errors are suppressed
    restore_error_handler();

    // Check if there was a error while loading file
    if ($this->_loadFileErrorStr !== null) {
        /**
         * @see Zend_Config_Exception
         */
        require_once 'Zend/Config/Exception.php';
        throw new Zend_Config_Exception($this->_loadFileErrorStr); <--- THIS ONE No. 182
    }

    return $iniArray;
}

但是,真的,无法弄清楚这件事。 提前致谢。我提出的第一个问题,当然,有点害怕问一些愚蠢的问题

3 个答案:

答案 0 :(得分:1)

问题出在

application.ini on line 29

删除/编辑此内容以进行测试。

答案 1 :(得分:1)

用引号括起用户名和密码。

答案 2 :(得分:0)

我有一种感觉,问题可能是你的if条件在它应该是假的时候返回true。

尝试更改ln。 177到:

if ($this->_loadFileErrorStr !== '') {

OR

尝试访问您的application.ini文件,并确保引用需要引号的值:

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
phpSettings.date.timezone = "Europe/London"
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.view.doctype = "XHTML1_STRICT"

[staging : production]
resources.db.adapter = "pdo_mysql"
resources.db.params.host = "localhost"
resources.db.params.username = "root"
resources.db.params.password = ""
resources.db.params.dbname = "zf-tutoria"
resources.db.params.charset = "utf8"
resources.db.isDefaultTableAdapter = true

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

我在这里发现了这个:http://www.z-f.fr/forum/viewtopic.php?id=6423

抱歉,这是法语版,但这最终成为类似(相同?)问题的解决方案。