views:

98

answers:

3

I am setting up a website in wordpress. the site was done by someone else. After setting up the site / database I get the following error:

Parse error: syntax error, unexpected $end in C:\Documents and Settings\user101\
Desktop\wordpress\wp-content\plugins\wp-301redirect\wp-301redirect.php on 
line 320

line 320 is the very last line of wp-301redirect.php page. I looked up what 301redirect is and it is apparently a plugin. The wp-301redirect.php page I have is exactly what the plugin provides (zip download). line by line.

Does anyone know what might be causing this.?

A: 

Try removing the last line after ?>. And generally it's advisable to not close your PHP with ?> as it's not required and prevents this from happening in the first place.

Polygraf
now this is my last line but still the error comes. ?>
john
what do you advise closing PHP with if not ?> I can try that too
john
A: 

Most likely, a function or control block is missing its matching end-brace, such as:

function foo() {
  //stuff
  ...

// EOF

OR

if (true) {
  ...

// EOF
John Reese
This file is exactly like the file that comes with plugin. i doubt any block is missing a brace
john
I downloaded the file and ran `php -l wp-301redirect.php` on the file, and it did not find any syntax errors. So either you accidentally munged the file, or (maybe) your PHP version is out of date and should be upgraded?
John Reese
+1  A: 

In the default file for this plugin. line 220 has <? it should be changed to <?php to fix this error

john