php 脚本仅在重命名后运行

a44*_*a44 1 php rename

这真的很奇怪:所以在我在另一个服务上上传一个包含 php 文件的文件夹并尝试从浏览器执行它们后,我得到 500 错误。如果我在文本编辑器中打开一个文件,用不同的名称保存它,如 file1.php ,然后删除原来的,并将file1.php重命名为以前的名称,它可以工作。

And*_* M. 5

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:

chmod 0644 <file>
Run Code Online (Sandbox Code Playgroud)