我在 PUT cURL 请求中收到“方法未实现 GET 到 xxx 不支持”


I am getting "Method Not Implemented GET to xxx not supported" in a PUT cURL request

我正在设置CURLOPT_CUSTOMREQUEST => 'PUT',在我的本地主机服务器中它按预期工作。但是在我的网络服务器中,我收到以下消息:

Method Not Implemented
GET to /web-services/index.php/attendance/user not supported.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

我发现了错误。我正在使用CURLOPT_CUSTOMREQUEST => 'PUT'。现在我只使用curl_setopt($ch,CURLOPT_HTTPHEADER,array('X-HTTP-Method-Override: PUT'));。