gpt4 book ai didi

linux - lighttpd 和 php 403 - 禁止访问

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:51:03 26 4
gpt4 key购买 nike

我正在尝试使用 lighttpd 和 php 将 xml 文件上传到 linux 板。

不幸的是,我收到 403 - 禁止错误。

error.log 中没有错误。

没有 fcgi。

web_root文件夹有

chown -R root:root /web_root

Ajax 请求

$.ajax({
url: "/cid/filename.cid",
method: "PUT",
data: xmlCID,
dataType: "xml",
processData: false,
success: function(data){
console.log(data);
},
error: function(jqXHR, textStatus, errorThrown){
alert(jqXHR.responseText, textStatus, errorThrown);
}
});

lighttpd 配置

server.modules              = (
"mod_rewrite",
"mod_access",
"mod_auth",
"mod_cgi",
"mod_accesslog" )

server.document-root = "/home/web_root/"
server.errorlog = "/home/lighttpd.error.log"

index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" )

server.event-handler = "poll" # needed on OS X

server.tag = "lighttpd/1.4.11 (Win32)"

accesslog.filename = "/home/access.log"

static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

server.upload-dirs = ( "/var/tmp/lighttpd-upload/" )

最佳答案

将以下内容添加到 lighttpd.conf,重新启动服务器,重新运行您的请求,然后检查您的 lighttpd.error.log。

debug.log-request-handling = "enable"

(你是打算把错误日志直接写入/home/?)

是否启用了 fastcgi 或 CGI 以在您的服务器上运行 PHP?我假设您在上面发布的 lighttpd.conf 中遗漏了这些行。检查 PHP 是否正在执行。它是否将请求记录到单独的日志文件中?检查 PHP 是否对您写入文件的位置具有写入权限。

关于linux - lighttpd 和 php 403 - 禁止访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31449215/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com