Title: Unexpected character and Parse Error&#8230;
Last modified: August 18, 2016

---

# Unexpected character and Parse Error…

 *  [cdcrash](https://wordpress.org/support/users/cdcrash/)
 * (@cdcrash)
 * [21 years ago](https://wordpress.org/support/topic/unexpected-character-and-parse-error/)
 * I just installed 1.5.1 and I’m getting an odd error:
 * If I click on “Previous Entries” on my main page, I’m getting the following error:
 * Warning: Unexpected character in input: ” (ASCII=12) state=1 in /usr/local/dh/
   cgi-system/php.cgi on line 2966
 * Parse error: parse error, unexpected T_STRING in /usr/local/dh/cgi-system/php.
   cgi on line 2966

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [cdcrash](https://wordpress.org/support/users/cdcrash/)
 * (@cdcrash)
 * [21 years ago](https://wordpress.org/support/topic/unexpected-character-and-parse-error/#post-203464)
 * oops double post~!
 *  Thread Starter [cdcrash](https://wordpress.org/support/users/cdcrash/)
 * (@cdcrash)
 * [21 years ago](https://wordpress.org/support/topic/unexpected-character-and-parse-error/#post-203465)
 * Ok, thanks to carthik on #wordpress on IRC, I found the problem…
 * [http://photostack.org/forum/viewtopic.php?pid=401](http://photostack.org/forum/viewtopic.php?pid=401)
 * basically, change the line
 * `$index = $_SERVER['SCRIPT_NAME'];`
    in the file: wp-includes/template-functions-
   links.php to: `$index = $_SERVER['PHP_SELF'];`
 * There’s one other file with the variable `$_SERVER['SCRIPT_NAME']` in it:
    wp-
   settings.php
 * If I find anymore problems, I’ll change it there too.
 * I think this has a lot to do with running PHP as CGI.
 *  [blikum](https://wordpress.org/support/users/blikum/)
 * (@blikum)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/unexpected-character-and-parse-error/#post-203637)
 * Oh, hell yes! Thank you. This post just fixed a buggin’ issue on my site. On 
   my index.php page the page pagination wasn’t working and I was getting the same“
   cgi-system” issue in my urls. I made the above change and it fixed it. Nice find
   cdCrash.
 *  [E R](https://wordpress.org/support/users/iiedwinii/)
 * (@iiedwinii)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/unexpected-character-and-parse-error/#post-203765)
 * Same here 🙂 Thanks A Lot!
 *  [nerdgirl](https://wordpress.org/support/users/nerdgirl/)
 * (@nerdgirl)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/unexpected-character-and-parse-error/#post-203834)
 * You rock! Thanks so much.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Unexpected character and Parse Error…’ is closed to new replies.

## Tags

 * [character](https://wordpress.org/support/topic-tag/character/)
 * [line](https://wordpress.org/support/topic-tag/line/)
 * [Unexpected](https://wordpress.org/support/topic-tag/unexpected/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 4 participants
 * Last reply from: [nerdgirl](https://wordpress.org/support/users/nerdgirl/)
 * Last activity: [20 years, 6 months ago](https://wordpress.org/support/topic/unexpected-character-and-parse-error/#post-203834)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
