开发者

lighttpd PHP Error: 403 - Forbidden

I have been trying to configure a web server using lighttpd on Windows. After installing PHP, everytime I try to access a PHP file from the directory 'htdocs,' I get the error: '403 - Forbidden.' I have followed this tutorial to setup lighttpd: http://joshdick.net/writing/lighttpd. I have searched Google,开发者_如何学Python but haven't found any good documentation on this problem. FYI: I'm pretty new to this. I have the content of my 'lighttpd-inc.conf' file here.

Any help would be greatly appreciated. Thanks!


There are a lot of things this could be. For instance, if you are using FastCGI on Windows there may be an issue (they don't play nice). It could be as simple as your folder permissions (in Windows) don't allow access to this folder. However, after trying to look over your .conf file (the lack of line breaks makes it a bear to read), I have a place you could start looking.

It looks like you are referring to the path to htdocs improperly. For example, this line here:

server.document-root = "HTDOCS/"

I don't think that path will work properly. Usually you have to have a "/HTDOCS/" style path. There are a number of lines like this throughout your file. Here is a link to some documentation on this:

http://redmine.lighttpd.net/wiki/1/server.document-rootdetails


Your cgi/fcgi to your php is not configured correctly. CGI or FCGI is the glue that binds PHP and lighttpd together. check your lighttpd error.log it will state something like:

(mod_fastcgi.c.1397) [ERROR]: spawning fcgi failed. 

i use:

fastcgi.server = ( ".php" => ((                                      
                     "bin-path" => "/bin/php-cgi",             
                     "socket" => "/tmp/php.socket",              
                     "max-procs" => 1,                                     
                     "bin-environment" => (                         
                       "PHP_FCGI_CHILDREN" => "16",                    
                       "PHP_FCGI_MAX_REQUESTS" => "10000"           
                     ),         
                     "broken-scriptfilename" => "enable"
                 )))   

make sure that fastcgi is enabled in modules.conf

server.modules = (
  "mod_access",
  "mod_fastcgi",
#  "mod_alias",
#  "mod_auth",
#  "mod_evasive",
#  "mod_redirect",
#  "mod_rewrite",
#  "mod_setenv",
#  "mod_usertrack",
)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜