简体   繁体   English

在Debian机器上使用php5-fpm和nginx

[英]Using php5-fpm and nginx in a debian machine

I am trying to set up nginx server to run a php app in debian. 我正在尝试设置Nginx服务器以在Debian中运行php应用程序。 I followed this tutorial among others. 我遵循了本教程 Most seems the same. 大部分看起来都一样。 My recent configuration is based on the link above. 我最近的配置基于上面的链接。 When I try to run this php script, 当我尝试运行此php脚本时,

<?php
    phpinfo();  
?>

I get the same output on the browser instead of php info result. 我在浏览器上得到相同的输出,而不是php info结果。 Kindly someone help me figure out where I went wrong. 请有人帮我弄清楚哪里出了问题。

Note: My error logs are clean,contains details on nginx server start only. 注意:我的错误日志是干净的,仅包含有关Nginx服务器启动的详细信息。

Thank you. 谢谢。

You might want to make sure php5-fpm is listening on the correct port you're expecting it to be using. 您可能要确保php5-fpm在您期望它使用的正确端口上进行监听。 Do a netstat listing and see if php-fpm is listening on port 9000: 做一个netstat清单,看看php-fpm是否在端口9000上监听:

netstat -tulpn

You should see a line that looks something like this: 您应该看到一行看起来像这样的行:

tcp   0  0 127.0.0.1:9000  0.0.0.0:*  LISTEN   2390/php-fpm.conf

If not, check your www.conf file (in /etc/php5/fpm/pool.d/www.conf ) and look for the "listen = ..." line and make sure it says: 如果没有,请检查您的www.conf文件(在/etc/php5/fpm/pool.d/www.conf中 )并查找“ listen = ...”行,并确保其显示:

listen = 127.0.0.1:9000

I have seen default configurations of php5-fpm use a socket instead of a tcp port. 我已经看到php5-fpm的默认配置使用套接字而不是TCP端口。

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

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