简体   繁体   English

仅基于PHP文件名的奇怪403错误-重命名文件,它可能会根据名称起作用?

[英]Strange 403 error based on filename of PHP files only - rename file and it may work depending on name?

I am experiencing a strange error yesterday on a shared hosting account. 昨天,我在一个共享主机帐户上遇到一个奇怪的错误。 I have contacted the provider, but I expect little, or at least very slow support, so I wanted to reach out to the community for some assistance. 我已经联系了提供商,但是我希望得到的支持很少,或者至少非常缓慢,因此我想与社区联系以寻求帮助。

I have some PHP files on this account that return a 403 error based on the filename along from that I can tell. 我在此帐户上有一些PHP文件,这些文件根据文件名返回403错误。 For example a file name ip.php gives a 403 error, but if renamed to in.php the same file with no other change and it works. 例如,文件名ip.php给出403错误,但是如果重命名为in.php,则该文件没有其他更改就可以工作。 Renamed back to ip.php gives a 403 error. 重命名为ip.php会导致403错误。 Renamed to ip.html or any other extention it reads, back to .php and it gives 403 error. 重命名为ip.html或它读取的任何其他扩展名,重新命名为.php,并显示403错误。 So far I have checked and changed permissions, tried new files, blank files, and removed .htaccess files, and disabled mod_security in my cpanel so far with no change. 到目前为止,我已经检查并更改了权限,尝试了新文件,空白文件,并删除了.htaccess文件,并且到目前为止,我的cpanel中没有更改都禁用了mod_security。 Depending on the file name it gives a 403 error. 根据文件名,它会显示403错误。 I checked many scenarios to try and narrow it down without luck, but to give more examples I could rename the same file to 1.php or config.php and get a error, but if I rename it to admin.php it will read again, so I have not figured out a common factor yes as to what causes it to work vs not work other then it only occurs with PHP files, and it happens regardless of file permissions and contents. 我检查了许多情况以尝试将其范围缩小到没有运气,但是为了给出更多示例,我可以将同一文件重命名为1.php或config.php并得到一个错误,但是如果我将其重命名为admin.php它将再次读取,所以我还没有弄清楚是什么导致它起作用或不起作用的共同因素,而是仅在PHP文件中发生,并且无论文件许可权和内容如何都发生。

Anyone experience this before? 有人以前经历过吗? Im open to hear your suggestions or guesses as well. 我很乐意听到您的建议或猜测。 Thanks! 谢谢!

perhaps you've made a mistake in the .htaccess file, and wanted to do something like: 也许您在.htaccess文件中犯了一个错误,并且想要执行以下操作:

<Files  ~ "\.ini$">
  Order allow,deny
  Deny from all
</Files>

but instead blocked other stuff? 而是阻止了其他东西?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM