Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A friend of mine is getting this error on ALL of her websites. They are all on the same server, externally hosted.(the hosting company says they cant help with scripting problems)

Each site even gives the exact some line number, but they all use different Index.php files. I am a bit stumped here, has anyone seen anything like this before?

Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/xxxx/public_html/index.php on line 17

Parse error: syntax error, unexpected '.' in /home/xxxx/public_html/index.php on line 17
share|improve this question

Based on the error and some googling, it seems the culprit is possibly some horribly crappy file manager.

How are you editing/uploading files to the site?

share|improve this answer
These files havent been edited for months. When they were edited, they were FTPed down, edited, and FTPed back up. This is a wordpress blog so some of the files change when posting and such but it shouldnt ever change the index.php file – user8140 Aug 13 '09 at 17:52
Hmm, I think I misread the error message and may have found the culprit.. there are multiple index files, some within the theme template, and one for wordpress itself which I think is the one giving the error.. I will post the fix after I compare different revisions of this file... or at least I think thats it – user8140 Aug 13 '09 at 17:55
The root index.php had some weird stuff in it with a broken line...line 17! ;) my friend says the hosting company emailed her saying her server had a breach, apparently they changed a bunch of stuff, changing the root index.php and reinstalling wordpress took care of all the errors. Thanks – user8140 Aug 13 '09 at 18:19
didn't you say that it was happening on many different sites and different index.php files? – drAlberT Aug 13 '09 at 19:46
This occasionaly happens with bad file transfers. – Wtower May 29 '14 at 9:27

I think you have a virus on your site. Check your index.php files for code like this:

<iframe src="" width=125 height=125 style="visibility: hidden"></iframe>
share|improve this answer

It's a syntax error in the PHP script. So most likely, whoever wrote that script made a mistake. But without some context as to the error (i.e. without knowing what exactly is in that part of the script), it's impossible to tell exactly how to fix it.

Incidentally, this is really a StackOverflow-type question.

share|improve this answer
Ah, I was trying to figure out where this would best fit. The thing is, these index.php files are different for each site and have been functioning for some time. I also changed the entire index.php on one to test and it gave the same error. I am suspecting server side change, but am not certain. – user8140 Aug 13 '09 at 17:32

Try to make an index.php with only, and exactly one line; the following could be a good one:

<?php phpinfo() ?>

one line, no \r or \n (say don't press return after the latter ">".

If the error persists I think the hoster could have added an auto prepended file directive or something similar. May be due to short_open_tag too if your scripts make use of such an (evil) feature.

Debugging with a single, simple line is a good starting point IMHO

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.