That's really strange :So after i upload a folder with php files on another service,and try to execute them from a browser,i get 500 error.If i open a file in a text editor,save it with different name like file1.php,then erase the original,and rename the file1.php to the previous name,it works.
This sounds a lot like a permissions issue. When you save the "second" file, you're saving it with permissions 0644 by default, with your user/group, at least on *nix. If you want, post the the output of
ls -l file1 file2 before you do the rename, and I can give you a better answer.
As for permissions, try changing the permissions on the original file by using
chmod 0644 <file>