Using php5-fpm and nginx in a debian machine

2019-09-18 04:36发布

I am trying to set up nginx server to run a php app in debian. 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
    phpinfo();  
?>

I get the same output on the browser instead of php info result. Kindly someone help me figure out where I went wrong.

Note: My error logs are clean,contains details on nginx server start only.

Thank you.

1条回答
相关推荐>>
2楼-- · 2019-09-18 04:52

You might want to make sure php5-fpm is listening on the correct port you're expecting it to be using. Do a netstat listing and see if php-fpm is listening on port 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:

listen = 127.0.0.1:9000

I have seen default configurations of php5-fpm use a socket instead of a tcp port.

查看更多
登录 后发表回答