We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39712
    • 31 Posts
    Installing Revo 2.2.2-pl, apache, linux, shared host, PHP 5.2.17 CGI/fastCGI mysql 5.0 browser Firefox 3.6.25

    Had a great install that went smoothly till the very last. Showing the summary page, click next to continue... yields this error:
    Parse error: syntax error, unexpected '{' in

    /modx-2.2.2-pl/core/config/config.inc.php on line 13

    The code in that file does not seem to have any errors, but it is the first curly brace in the file. Does anyone have an idea where the real error might be?

    Thanks! [ed. note: larrybqd last edited this post 14 years, 4 months ago.]
      • 39712
      • 31 Posts
      Final update... Problem was apparently an incorrect setting for the database involving DB charset. Did a complete delete and reinstall with a new DB, and not only did it install, it finished and is running. Now I can start learning modx...

      earlier:
      ...Well, no info on this topic in searches, and no responses to this post.

      A Successful install isn't successful till it actually works. One site talks about having to install 4 times when they first started before it worked right. If anyone is reading this... the previously described error occurs with any attempt to visit the domain. Requests for phpinfo on the site triggers a 500 error instead of the php settings.

      Reminder, this stuff was all working and set up before and during the install. Each step got resolved with minimal fuss, all tests worked correctly, and I got the screen declaring a successful install, with a summary of all that had been done. Clicked "next" and it all broke apparently.

      The unanswered question? Is this an error requiring a complete re-install? Really? I hope I don't have to reinstall continually after the site is started... ?

      I'm on the learning curve here so appreciate discussion to help understand things, even if I've worked out a solution on something. I've provided tech info above on my situation, if you can help and want more specific details, I can provide them as needed.

      Thanks!
      [ed. note: larrybqd last edited this post 14 years, 4 months ago.]
        • 32316
        • 387 Posts
        Well sometimes a file gets 'messed up' in the upload process, in which case the safest thing is to start over.

        I just looked at a config file and the first '{' curly bracket I see is on line 23 - mystery #1
        Usually a parse error like that is often in the line before the 'error' but in this case if you lines are similar to mine then a '{' instead of a '(' would be unexpected.

        My lines 11 - 14
        $table_prefix = 'modx_';
        $database_dsn = 'mysql:host=localhost;dbname=xxxxxx_xxx;charset=utf8';
        $config_options = array ( );
        $driver_options = array ( );
          • 39712
          • 31 Posts
          Hi Whistlemaker, Thanks for your post in reply. Perhaps you missed my "final" status at the top of the last update? My particular "parse error" turned out to be that my DB was incorrectly set. When creating it I allowed a "default" setting to remain as it was, indicating that the DB was to use "Latin1" as the charset. I deleted that DB and created a new one in which I specified to use "utf8" and that fixed the problem.

          The line numbers between your file and mine could be different for a number of reasons. I'm running MODx 2.2.2-pl. In my case, there was a curly brace on the line specified in the error message yet it was obviously not the config file that was at fault.

          It's true that typically an "error" occurs before encountering the curly brace, but it isn't necessarily located on the previous line of code. This error was an error of trying to read the data using the wrong data type methods, beginning at the top of the config file hence the curly brace became a problem.
            • 32316
            • 387 Posts
            Thanks for the 'Thanks'
            I probably started my reply before you updated your post and then I got distracted so it took a while before I posted. Also being able to update posts has its drawbacks since the flow/timeline of a thread can be destroyed.
            but it isn't necessarily located on the previous line of code.
            which is why I said "often" - very hard to know when responding in the forums the technical level of expertise of anyone, and providing help without offending.
            As to line numbers - the excerpt from the config file I posted was from a 2.2.2 install though I suppose it might be left over from an upgraded older version - you did not post the any of your config file so I and other readers must guess to the content of your config file.
            Curiousity got the better of me:
            I did a fresh install of 2.2.2 on my laptop.
            the config.inc.tpl file:
            <?php
            /**
             *  MODX Configuration file
             */
            $database_type = '{database_type}';
            $database_server = '{database_server}';
            $database_user = '{database_user}';
            $database_password = '{database_password}';
            $database_connection_charset = '{database_connection_charset}';
            $dbase = '{dbase}';
            $table_prefix = '{table_prefix}';
            $database_dsn = '{database_dsn}';
            $config_options = {config_options};
            $driver_options = {driver_options};

            and yes line 13 has a curly brace ...
            after installing (a fresh local install on my machine) config.inc.php is created which looks like this:
            <?php
            /**
             *  MODX Configuration file
             */
            $database_type = 'mysql';
            $database_server = 'localhost';
            $database_user = '222';
            $database_password = '222';
            $database_connection_charset = 'utf8';
            $dbase = 'modx222';
            $table_prefix = 'modx_';
            $database_dsn = 'mysql:host=localhost;dbname=modx222;charset=utf8';
            $config_options = array ( );
            $driver_options = array ( );

            no curly braces - the {...} in the template have been replaced
            I also noted that the default encoding presented to me matched the database that I created for the install - utf8

            Anyway glad you sorted out your problem.
            [ed. note: whistlemaker last edited this post 14 years, 4 months ago.]
              • 39712
              • 31 Posts
              Yeah, the flow of time and timeline... I "edited" the question because it seemed no one was responding and a lot of time had passed. Also in hindsight, had I posted more code others might have pointed out the error earlier. Or, had I tried to post the code I would have found it earlier... Or, I believe I may have been thinking of posting the code when I noticed the line 12 issue, and went to fix it before posting again. If I can see an error it makes sense to attempt a fix before continuing to ask questions. I ask questions when I'm having trouble recognizing the error, knowing that it is likely staring me in the face! wink

              Here's the hindsight...
              There are several config files with this name. The error generating file was specifically:
              core/config/config.inc.php

              I left out the rest of the URL stuff. I didn't compare features of code vs line numbers in the other files, but I note that they are not identical to this one in size. Since I did not write or modify this file, and it had no obvious error in syntax or layout, the specific line of code was pretty much immaterial to the issue. Whatever it had was supposed to be just like it was. That is a good guiding rule under the circumstances...

              For clarification in hindsight, here's that line of code in my file:
              13 $config_options = {config_options};
              14 $driver_options = {driver_options};

              It was line 12 where the "problem" shows up in the DB statement, and that's what sent me off to change my database... I had allowed a default value to be used during setup and it wasn't right.

              12 $database_dsn = (code snipped) ;charset=latin1';

              Thanks!

              [ed. note: larrybqd last edited this post 14 years, 3 months ago.]