简体   繁体   English

opensuse php-fpm lighttpd 403,是权限问题吗?

[英]opensuse php-fpm lighttpd 403, is it a permissions issue?

So far I have configured php-fpm configured and is up and running listening to port 9000到目前为止,我已经配置了 php-fpm 并已启动并运行监听端口 9000

lighttpd is running and serves static files the problem that I have seems to be a permissions issue, so i chmod 777 -R /srv when I try to access index.php (which has phpinfo()) I get "access denied" in the browser. lighttpd 正在运行并为 static 文件提供服务,我遇到的问题似乎是权限问题,所以当我尝试访问 index.php(其中有 phpinfo())时,我 chmod 777 -R /srv 我在浏览器。

in my fastcgi.conf I have在我的 fastcgi.conf 我有

server.modules += ( "mod_fastcgi" )

fastcgi.server += ( ".php" =>
        ((
                "host" => "crunchyboy",
                "port" => 9000
        ))
)

if I use the browser to navigate to http://crunchyboy/index.php I get "Access Denied" that shows up in the access log as a 403 if i make up a file name like doesnotexist.php eg http://crunchyboy/doesnotexist.php I get a 404 file not found. if I use the browser to navigate to http://crunchyboy/index.php I get "Access Denied" that shows up in the access log as a 403 if i make up a file name like doesnotexist.php eg http://crunchyboy /doesnotexist.php 我得到一个 404 文件未找到。 If you are wondering about crunchyboy its the name of the machine and I can access it on the LAN.如果你想知道 crunchyboy 它是机器的名称,我可以在 LAN 上访问它。 eg http://crunchyboy/index.html is ok例如 http://crunchyboy/index.html 没问题

if I stop the php-fpm with systemctl stop php-fpm and navigate to index.php I get 503 Service Unavailable如果我用 systemctl stop php-fpm 停止 php-fpm 并导航到 index.php 我得到 503 Service Unavailable

so to me it looks like lighttpd is able to make a request to php-fpm but for some reason the file cannot be accessed.所以对我来说,看起来 lighttpd 能够向 php-fpm 发出请求,但由于某种原因无法访问该文件。

I've configured php-fpm with nginx and apache in the past (more than 5 years ago) and did not have this problem.我过去(5 年多以前)用 nginx 和 apache 配置了 php-fpm 并且没有这个问题。

I am really stuck with this, so would appreciate help or atleast ideas on what I need to look at.我真的坚持这一点,所以希望得到帮助或至少对我需要查看的内容提出想法。

Both lighttpd and php-fpm are set to run as user: lighttpd group:lighttpd Its on opensuse tumbleweed, recently updated lighttpd 和 php-fpm 都设置为以用户身份运行: lighttpd group:lighttpd 它在 opensuse tumbleweed 上,最近更新

Many thanks in advance提前谢谢了

chmod 777 is never the proper solution. chmod 777永远不是正确的解决方案。

If you are running php-fpm, then php-fpm is running your application.如果您正在运行 php-fpm,那么 php-fpm 正在运行您的应用程序。 Check your php-fpm configuration.检查您的 php-fpm 配置。

My hunch is that you have not configured your firewall to allow access to public port 9000, or have not configured crunchyboy in DNS or /etc/hosts.我的预感是您没有配置防火墙以允许访问公共端口 9000,或者没有在 DNS 或 /etc/hosts 中配置 crunchyboy。 In any case, you should probably instead be using 127.0.0.1 instead of crunchyboy .无论如何,您可能应该使用127.0.0.1而不是crunchyboy

server.modules += ( "mod_fastcgi" )

fastcgi.server += ( ".php" =>
        ((
                "host" => "127.0.0.1",
                "port" => 9000
        ))
)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM