I'm attempting to install Drupal 7 for the first time and have done nothing to modify any files, just uploaded them to my web space and CHMOD'ed a directory as instructed. However, when attempting to run the install script I got the following error message:

Parse error: syntax error, unexpected '{' in /home/fredr5/public_html/allison/includes/bootstrap.inc on line 677

The line in question is:
try {

In context:

  // Verify that we have an active database connection, before querying
  // the database. This is required because this function is called both
  // before we have a database connection (i.e. during installation) and
  // when a database connection fails.
  else {
    try {
      if (function_exists('db_query')) {
        $file = db_query("SELECT filename FROM {system} WHERE name = :name AND type = :type", array(':name' => $name, ':type' => $type))->fetchField();
        if (file_exists(DRUPAL_ROOT . '/' . $file)) {
          $files[$type][$name] = $file; 
        }
      }
    } 

I'm entirely unfamiliar with the code so I didn't want to add or delete anything without finding out what was going on and seeing if perhaps anyone else was having the same problem. I'd appreciate any help, thanks!

---

SOLVED! (1/18/2011)
I'm hosted through LunarPages, where the default PHP configuration is apparently to use PHP4. Their wiki had instructions, but I couldn't find the button they were telling me to look for. Instead, I chose "PHP Configuration" under the "Software/Services" section and changed the dropdown selection from "system default" to "PHP5". It sounds like others have been having this problem with 1and1, as well, and have posted their solutions in the comments.

Thanks for your help!

Comments

kmcgraw’s picture

I am getting the same error message when trying to instal. I'm using 1and1 web hosting if that matters.

Ambiguity’s picture

On a 1and1 account, add this line at the top of the .htaccess file to run in PHP5:

AddType x-mapp-php5 .php

franz2108’s picture

I am getting the same error too!

With PHP 5.2 OK!!!!

kenai35’s picture

I had this same "Parse error /bootstrap.inc on line 677" error when installing drupal 7 on 1and1. 1and1 support changed something in .htaccess which corrected the issue.

heine’s picture

Please see the requirements for Drupal 7. You need PHP 5.2.5 or higher.

Even if your host says it supports PHP 5, it might still need to flip a switch from PHP 4 to 5.

tmacy’s picture

I really like Bluehost hosting services. They provide nearly every tool and customization option. But when I attempted a custom install (actually, a move: Drupal 7 installation and its DB moved from an institutional site to Bluehost) I got this error:

Parse error: syntax error, unexpected '{' in //includes/bootstrap.inc on line 676

But thanks to Heine's tip, I found the PHP config utility on the cPanel where I simply enabled PHP5 and Drupal fired right up.

gaballison’s picture

I'm hosted through LunarPages and had to change my PHP Configuration to automatically use PHP5 for all PHP pages instead of the default (which apparently was using PHP4).

Thanks for your help! It never would have occurred to me to look at that.

grinfuses’s picture

I have the same problem, but my hosting have PHP5 in .htaccess .

What I can do?

Thanks!