One more problem solved today. PHP files were uploaded to our FTP server but we got a bunch of errors. That was strange because code worked correctly in local host. We figured out that our server deleted all “ End of Line” symbols – all code was placed in one line.
We checked our file with Notepad ++. Opened it and selected View->Show Symbol->Show End of Line:
As you can see in the picture all lines end with CR (carriage return) symbol. We changed it to LF (line feed) symbols with Notepad ++. Selected Edit->EOL Conversion->Unix Format:
After saving and uploading to FTP server it worked correctly – that solved our problem.
We found out that Pure-FTPd server deleted CR (carriage return) symbols. You can read more about this problem here.
If you are interested in different Line ending symbols (CR, LF, CRLF) in different operating systems you can find more information here.
This method did not solve your problem?
If this does not solve your problem try to transfer your files in BINARY mode. You can change transfer mode in Filezilla by selecting it in Transfer->Transfer type->Binary (by default it uses Auto – automatic detection):
It is better to try changing your â€œLine endâ€ symbols to resolve this problem than to use BINARY mode. As I Know binary mode can damage your files â€“ more information can be found here.
I hope this post will save somebodyâ€™s time If you have some questions just contact us â€“ we will try to answer them ASAP!