pepperav
pepperav

Reputation: 537

lighttpd and php 403 - Forbidden

I'm trying to upload a xml file using lighttpd and php into linux board.

Unfortenly, I get a 403 - Forbidden error.

No errors into error.log.

No fcgi.

web_root folder has

chown -R root:root /web_root

Ajax request

$.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 conf

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/" )

Upvotes: 1

Views: 3058

Answers (1)

gstrauss
gstrauss

Reputation: 2404

Add the following to lighttpd.conf, restart the server, re-run your request, and then check the your lighttpd.error.log.

debug.log-request-handling = "enable"

(Did you intend to write the error log directly into /home/ ?)

Is fastcgi or CGI enabled to run the PHP on your server? I presume you left those lines out of the lighttpd.conf posted above. Check that the PHP is being executed. Does it log requests to a separate log file? Check that the PHP has write permission to the location to which you are writing the file.

Upvotes: 3

Related Questions