为什么我的脚本会返回:HTTP ERROR 500(Why does my script return: HTTP ERROR 500)

编程入门 行业动态 更新时间:2024-10-24 08:21:22
为什么我的脚本会返回:HTTP ERROR 500(Why does my script return: HTTP ERROR 500)

我的apache服务器上有一个包含多个php脚本的文件夹。 此文件夹中的所有php脚本都可以工作,除了1.所有PHP脚本(包括不起作用的脚本)都具有相同的权限。

当我在浏览器中运行脚本时出现此错误:

HTTP ERROR 500

可能有用的详细信息:

PHP版本7.0.11 Apache / 2.2.15(CentOS)

There is a folder on my apache server containing several php scripts. All the php scripts in this folder work except for 1. All the php scripts including the script that doesn't work have the same rights.

When I run the script in my browser I get this error:

HTTP ERROR 500

Details that may be helpful:

PHP Version 7.0.11 Apache/2.2.15 (CentOS)

最满意答案

Apache状态代码500表示“内部服务器错误”。 如果没有看到产生此错误的代码,很难说是导致它的原因,但首先要检查的是服务器配置和.htaccess文件。 确保您的服务器正常运行然后检查您的.htaccess文件,因为一个错误的规则会强制某些类型的PHP出现故障。 正如@RiggsFolly所说,问题也可能是一些编写得非常糟糕的PHP,可以用一个简单的程序替换它来测试,如: <?php echo "test"; ?> <?php echo "test"; ?>

An Apache status code of 500 means "internal server error". Without seeing the code that is producing this error it is hard to say what is causing it but the first things to check are server configuration and your .htaccess file. Make sure your server is running properly then check your .htaccess file as a bad rule can force some types of PHP to malfunction. As @RiggsFolly stated, it is also possible that the problem is some very poorly written PHP which can be tested by replacing it with a simple program like: <?php echo "test"; ?>

更多推荐

本文发布于:2023-08-05 09:50:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1431219.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:脚本   HTTP   ERROR   return   script

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!