We have a problem when uploading PHP files to our production NFS server where we start getting PHP parse errors after uploading them. The only way to "fix" them, is to open them with vim and save without making any changes through SSH. This makes me think it might be related to the file encoding. I can't seem to find any info on how to fix this anywhere.
We use FileZilla to upload the files through SFTP.
Things we have tried so far:
- Checking everyone is editing the files with UTF-8 without BOM encoding.
- Changing FileZilla's file transfer type to binary (if using SFTP, transfer type is always binary).
ParseError: Uncaught exception 'ParseError' with message 'syntax error, unexpected '} '' in XXXXXX.php:XXXX Uncaught exception 'ParseError' with message 'syntax error, unexpected ''] = '' (T_CONSTANT_ENCAPSED_STRING)' in XXXXX.php:XXXX
Server info: AWS EC2 Instance running NFS. The NFS is used by multiple auto-scaling instances running Apache and PHP7 with OPCache enabled.