Forum Moderators: coopster

Message Too Old, No Replies

PHP files changing on host?

         

tgitm

5:58 pm on Nov 7, 2006 (gmt 0)

10+ Year Member



Recently been getting some strange behaviour with my PHP files.

About 2 weeks ago after some weird page bugs I pulled down the live pages to check them out for errors, only to find 75% of the PHP scripts had increased in line size. For some unknown reason a lot of the files had a lot of extra blank lines, seemed that everywhere a blank line had been there were now between 2 and 6 of them. Not easy to read the code with so much white space in the files.

So I fixed all the pages, deleted the live versions and re-uploaded. Decided to give it 5mins and pull a page down at random, extra lines returned.

Decided to test if this was a transfer or PC problem so copied the files I fixed earlier to a memory stick, took them home, checked they were correct and logged into the FTP, deleted the current live and uploaded the fixed versions again. Gave it 5mins and pulled a page down, lines were increasing again.

Checked one of the HTML files that are there too, and they were still in their original state.

Today I get huge code errors from my site, pull down the pages erroring and there are NO line breaks at all, infact some code lines got moved up onto the same line as comment lines, making the code part of the comment and thus breaking the page.

Contacted host who basically said there was nothing wrong with the server at all but they'll investigate it.

Anyone got any other suggestions on the cause? I'm under the impression it's a problem with the server itself, but never seen this problem before so want to be sure before I move the site to a more reliable host.

barns101

6:15 pm on Nov 7, 2006 (gmt 0)

10+ Year Member



I once experienced the same thing with new lines being added to a PHP file (only one as far as I remember). However, as it was a pretty isolated incident and didn't cause any problems, I thought nothing of it... until now!

eelixduppy

9:04 pm on Nov 7, 2006 (gmt 0)



Welcome to WebmasterWorld, tgitm!

This is a strange problem indeed. I skimmed the PHP bugs databases and didn't find anything relevant to your problem. When this started happening (or when you realized it) did you change anything? Did your host make any changes to their system?

I'm curious to see what your host has to say about this; keep us updated!

tgitm

9:00 am on Nov 8, 2006 (gmt 0)

10+ Year Member



Thanks for the welcome.

No I didn't change anything, well other than fixing the files after the bugs randomly appeared when the files changed.

Hopefully the host will get back to me today, I expect them to pass the blame elsewhere but other areas of their infastructure have been having problems of late so I wouldn't be suprised if their hosting servers were having problems too.

I must admit this is the first time I've ever encountered this problem after running sites for years, and I'm glad I'm not the only one who's puzzled by it. I will update as things develop.

breham

8:29 pm on Nov 8, 2006 (gmt 0)

10+ Year Member



Hi tgitm,

I've had similar problems with PHP files but also with .txt files such as robots.txt.

The only thing I could find causing it was if I upload it using my FTP Clients "Automatic" upload option. Changing to ASCII seemed to resolve the problem for me

There were 3 options as far as I could remember ASCII, Binary and Automatic.

Symptoms were the same as you mentioned either additional lines of white space or the code was all bunched up and unreadable. Most cases though the code still seemed to work.

I'm not sure if this is related to the type of host (Apache, windows etc ) or if it is an issue with the FTP Protocol?

Brett

coopster

8:31 pm on Nov 8, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Have you been checking the filemtime to see the modified date? It will have a timestamp and you could cross reference that with your access_log and perhaps error_log to see if anything is relative.