-1

I made some changes to a client site, and then uploaded the changed files via filezilla. The site isn't working anymore :-( I checked the source code of the files on the server to make sure they were updated, and I see that some of the files have a lot of whitespace removed. ie, multiple statements on one line. actual php code is commented out because the single-line comment just keeps going on. In my local file, it looks like this:

//here is a comment
$xyz = 123;

But the file on the server looks like this:

//here is a comment $xyz = 123;

and I'm guessing that's why it's broken!

I tried re-uploading over and over, and nothing doing. Really stuck here, no clue what is going on. Any ideas, thanks.

esther h
  • 1,468
  • 2
  • 17
  • 35
  • how are you uploading those files as, binary or text (or automatic)? this is all I can think of right now. – Funk Forty Niner Dec 12 '16 at 13:02
  • that, or filezilla might have settings on linebreaks also and is interpreting them differently. Edit: after seeing @Phylogenesis 's comment, is what I meant by that. – Funk Forty Niner Dec 12 '16 at 13:03
  • Are the lines *actually* merged? Or are you viewing the files in Notepad that has no support for Unix line endings? – Phylogenesis Dec 12 '16 at 13:03
  • a temporary fix till you figure it out would be `/* here is a comment */ $xyz = 123;` – Funk Forty Niner Dec 12 '16 at 13:07
  • you've an answer below, maybe you'll answer to them instead of comments. You asked for help, you got it. good luck, I moved on. – Funk Forty Niner Dec 12 '16 at 13:11
  • why did my question get a -1? it was a legit question, got a legit answer – esther h Dec 12 '16 at 13:44
  • Possible duplicate of [Eclipse and Windows newlines](http://stackoverflow.com/questions/1886185/eclipse-and-windows-newlines) – Shirkam Dec 12 '16 at 13:44
  • @Shirkam not really, you wouldn't search for that question unless you knew that it was the newlines causing the problem! that's why i couldnt find any answers to help me and had to ask a new question. hopefully this question will help others figure out their problem too. – esther h Dec 12 '16 at 13:46

1 Answers1

1

It'very possible that those files where created in one system, and edited in other. Doing that without having propper file format, causes that sort of things. Try to edit them with the first system, or, convert all newlines to the new format. This is all about unix/linux newlines and windows CR. Conflicting even here.

Shirkam
  • 744
  • 6
  • 20
  • i edited them in windows in eclipse, and ftp them to a linux server. what do i need to change to get it to work? – esther h Dec 12 '16 at 13:12
  • Go to eclipse preferences, and change wich newline is using, this should be under languaje options. Change Windows CR to linux's. It should work. – Shirkam Dec 12 '16 at 13:16
  • I was wrong, it is under project options->resource newlines. At least in Kepler to Neo versions. – Shirkam Dec 12 '16 at 13:21
  • found the answer here, thanks. http://stackoverflow.com/a/1887619/354030 – esther h Dec 12 '16 at 13:43