【发布时间】:2014-01-26 22:26:54
【问题描述】:
我有一个 ajax 调用:
$.ajax({
url: "http://localhost/kidsKnitsDB/edit.php",
type: "post",
data: id,
beforeSend: function(response){alert('Sending');},
success: function(response){ alert('success');},
error: function(response){alert('failed');},
complete: function(response){alert('finished');},
});
这会导致如下所示的 500 服务器错误:
Request URL: http://localhost/kidsKnitsDB/edit.php
Request Method: POST
Status Code: HTTP/1.0 500 Internal Server Error
Request Headers 17:09:44.000
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0
Referer: http://localhost/kidsKnitsDB/index.php
Pragma: no-cache
Host: localhost
Content-Length: 0
Connection: keep-alive
Cache-Control: no-cache
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Accept: */*
Response Headers Δ4ms
X-Powered-By: PHP/5.3.10-1ubuntu3.9
Vary: Accept-Encoding
Server: Apache/2.2.22 (Ubuntu)
Date: Sun, 26 Jan 2014 22:09:44 GMT
Content-Type: text/html
Content-Length: 192
Content-Encoding: gzip
Connection: close
如果有人打电话求助,我们将不胜感激,我不确定我为什么会得到这个。我也很好奇 url 属性应该是原样还是应该是../edit.php?我想我拥有它的方式是正确的,因此 apache 可以解释 php。
【问题讨论】:
-
HTTP 5xx = 服务器故障。接收调用的函数正在死亡。检查日志。
-
500 内部服务器错误检查后参数听起来不正确
-
反对者应发表评论以解释。这个问题在我看来是合理的。
-
我要发一个号码,应该连载吗?
标签: php jquery ajax apache internal-server-error