I wasted about an hour with this issue today so hope to save time for someone else or even me in the future by posting it here. I completely debugged a file in PHP, but kept getting errors in PHP saying that there was a syntax or parse error of some sort or another.
The solution was to simply go to FileZilla and use the top toolbar to navigate to Transfer/Transfer type/binary and problem solved! You can read on if you wish, but if you just want to fix it and continue working as I often do, feel free and stop reading here.
Here is an excerpt I got from http://stackoverflow.com/questions/5704224/php-parser-error-when-viewing-same-file-saved-in-windows:
I have a PHP file for my website, index.php, which, as it stands on the server, it works correctly, no errors triggered and the page loads as it should.
The server is a Linux server running Apache, and my local machine is a Windows machine. Using the FileZilla Windows client, I download index.php and open the file in Notepad++ in Windows. I save this file in Windows, and then upload and overwrite the file on the server. The page now does not load, with this error on the page:
I've Googled this error quite a bit, and all of the answers I've come across detail that it's either a PHP short tags problem (replacing
What is even more puzzling is that I was able to create a
Any ideas? I'll try to provide more information if I've omitted anything, but I really don't think the source is required here.
Try setting transfer type to BINARY instead of TEXT in your filezilla client. This might be an issue with transfer encoding rather than notepad++ as I have faced a similar problem earlier which was resolved by forcing transfer to binary.