: New line characters stopped getting written to PHP app's log file after switching FTP clients I have a website running on PHP and I fwrite a log file. I append PHP_EOL to get each log
I have a website running on PHP and I fwrite a log file. I append PHP_EOL to get each log entry on a new line. This was working fine but about a week ago the newlines stopped appearing so the logfile is garbled. I tried replacing PHP_EOL with rn but no difference. I haven't edited the script for over a year. I'm stumped.
More posts by @Karen161
1 Comments
Sorted by latest first Latest Oldest Best
The problem coincided with changing FTP clients (from FileZilla to "CoffeeCup Free FTP") and was possibly the result of EOL conversion during an ASCII FTP file transfer. Or even transferring in "Binary" mode from a Linux server to Windows. Typically, the FTP client will default to ASCII transfer mode for certain file types, but this is configurable within the FTP client.
In ASCII transfer mode, the EOL should never be removed completely. However, it is also dependent on the editor being used to view the resulting file and how it interprets the line endings. For example, if the EOL is the unix style n then trying to display this in Windows Notepad it will all appear on one line. However, an editor like SublimeText will correctly interpret the line endings and display the file as intended.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.