user968865
user968865

Reputation: 97

zf-tutorial Fatal Error

i am starting with zend, with zf-tutorial (the cd app), but i received:

! ) Fatal error: Uncaught exception 'Zend_Config_Exception' with message 'syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in C:\wamp\www\zf-tutorial\library\Zend\Config\Ini.php on line 182 ( ! ) Zend_Config_Exception: syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in C:\wamp\www\zf-tutorial\application/configs/application.ini on line 29 in C:\wamp\www\zf-tutorial\library\Zend\Config\Ini.php on line 182

I checked 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;
}

But, really, cant figure out the thing. Thanks in advance. First question i make, and sure, little afraid of having asked some silly

Upvotes: 1

Views: 3704

Answers (3)

Real Dreams
Real Dreams

Reputation: 18010

Wrap the username and password with a quotation mark.

Upvotes: 1

tjb1982
tjb1982

Reputation: 2259

I have a feeling the problem may be that your if condition is returning true when it should be false.

Try changing ln. 177 to:

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

OR

Try going to your application.ini file and make sure the values that need to be in quotes are quoted:

[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

I discovered this here: http://www.z-f.fr/forum/viewtopic.php?id=6423

Sorry, it's in French, but this ended up being the solution to a similar (the same?) problem.

Upvotes: 0

Mr Coder
Mr Coder

Reputation: 8186

problem is at

application.ini on line 29

remove/edit this to test .

Upvotes: 1

Related Questions