Search code examples
phpftpasciifilezilla

PHP scripts changing to random characters when uploading FTP


A bit of a strange problem here.

I am using FileZilla and Notepad++ on my work machine.

Basically whenever I upload a PHP script all the code turns into random characters

For example this code:

<?php echo 'hello world'; ?>

turns into

<?php ਍攀挀栀漀 ✀栀攀氀氀漀✀㬀ഀ ?>

My FTP transfer mode is set to ASCII. Am I doing anything wrong, is it a bad FTP setting?

Thanks Peter


Solution

  • Your ftp client botches the characterset of your input. Change the upload mode to binary and you're done.