View Full Version : My index.php file size is increasing dramatically

08-05-2008, 11:28 AM
Dear friends,

I have just notices that my index.php file size has incresed from 47K to 775K , what could be the reason ? I think this will take a hell lot of time to open from slower internet connection user. Is this something like hack attempt or my own coding mistake ? Any help would be greatly appreceated.


08-05-2008, 12:10 PM
Open your index.php file and look.

Or copy it here

08-05-2008, 01:21 PM
Thank you allahverdi,

What I have noticed after opening file in dreamweaver is, its has 377031 lines and there are lot of empty spaces between the lines. I am not sure why this is happening, Is there anyways to tidy up all the javascript, php and html code ? Please help me.

also I am not sure what is causing all this. Thank you.

08-05-2008, 11:40 PM
Ah, well. No file should be that long. Nor should it be growing. This either sounds like some weird bug, or some weird hack attempt. Without seeing the file in question, I can't really say.

08-06-2008, 12:44 AM
Well if they didn't change anyything I don't see how it could be a hack attempt. Sounds like something from his editor.

08-07-2008, 03:40 PM
I don't know how dreamweaver is causing this. If that was a hack attempt also I am wondering how people would attempt to hack at index.php, there are no other codes than few php includes.

Could it be dreamweaver itself?

08-07-2008, 03:41 PM
Sorry but I don't want to post my private file in public. :( I have posted it one time and google search was bringing this error page of my site just below my web homepage. I don't think any webmaster would post thier original index.php file in any public forum.

08-07-2008, 03:43 PM
More than likely, it is either the editor or the the way it is being uploaded to the server. I lean more towards the editor as I have never seen a case like this with the way a file is uploaded. As for the hack attempt conclusion, I have not seen any cases to where a hack attempt would just place a ton of empty space in your file to make it so large that it would take forever to load. Usually a hack attempt would try to replace the index page altogether to either promote or redirect to their site. Try using notepad or another "plain text" editor and see if that fixes it.

Hope this helps.

08-07-2008, 05:46 PM
I had a friend who had a problem like that once, but it was his own coding mistake. He'd used a loop which would never end.

while (1) {
echo "<br>\n";

08-07-2008, 06:08 PM
Try creating it and then after saving open it in wordpad or notepad and make sure it is how it is supposed to be.


One answer is this:

When you say 'blank lines', do you mean totally empty lines in the source-code, or lines like this:


Either way, if you have all the pages organised into a DW Site, you could use the Find/Replace tool sitewide. The tool can use regular expressions

To get rid of blank lines (or lines containing only spaces) in source, replace



To get rid of lines with only <p>&nbsp;</p> (<p> tag may have attributes), replace




I'd suggest running this on a test page first, to make sure you get the results you expect.

And also this in reply:

Apologies if I patronise, but you realise I meant to press Shift+Enter in the box, not to actually type "<Shift+Enter>"? Shift+Enter renders a line-break in the box. To match your blank lines it should be


08-09-2008, 08:13 AM
I did just downloaded the file from server which was 416k, I did only edit one line (plain text) in dreamweaver and when i saved the file again, file size became 811K,

I wanted to to show the file to one of you but I really don't want to make it public , it's like community site.

08-09-2008, 08:18 AM
They are like this



<!--google analytics end..-->