Home  >  Q&A  >  body text

nginx - php-fpm cannot start after changing default port

Recently built an nginx server that supports PHP on Centos 7. nginx, PHP and php-fpm were all installed using yum and used normally.
But because other programs need to occupy port 9000, the configuration in /etc/php-fpm.d/www.conf is changed:

listen = 127.0.0.1:32328

After modification, php-fpm cannot be started, and the error message is as follows:

Permission denied error occurred
The strangest thing is that after changing it back to 9000, it can start smoothly again!
Tried to modify the listen owner, listen group and listen mode in /etc/php-fpm.d/www.conf

listen.owner = nginx
listen.group = nginx
listen.mode = 0666

I also turned off the Centos 7 firewall, but still got the same error
Could you please tell me what the problem is, thank you!

PHP中文网PHP中文网2713 days ago1259

reply all(3)I'll reply

  • 大家讲道理

    大家讲道理2017-05-16 17:18:28

    CentOS7’s selinux seems to have restrictions on port binding above 1024, so you should check Selinux first. If there is any, you can turn it off first.
    getenforce to see if SELinux is turned on. If so, turn off selinux and start it again
    http://www.jb51.net/LINUXjishu/192576.html

    reply
    0
  • ringa_lee

    ringa_lee2017-05-16 17:18:28

    By the way, I would like to ask how to elegantly pin outdated questions to the top

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-16 17:18:28

    I suspect that your port is occupied. . . .

    reply
    0
  • Cancelreply