linux - lighttpd 和 php 403 - 禁止访问

标签 linux lighttpd

我正在尝试使用 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/

相关文章:

php - lighttpd PHP 错误 : 403 - Forbidden

linux - 计算机器接收到的 ping 数量

c - 每个进程内存中的共享库是如何寻址的?

linux - sybase IQ 网络客户端安装

linux - 在 linux 中杀死一个进程实际上并不会杀死它

django - lighttpd mod_rewrite 与 Django 和 FastCGI 的 apache mod_rewrite

c++ - 在 linux 中调用 socket.close 后 socket.read_some 需要很长时间才能返回

php - 如何告诉浏览器忘记 htdigest?

linux - 我需要为此使用什么 openssl 命令?

ssl - 网络套接字。 FastCGI 或 WSGI。 SSL。同域。如何?