CentOS boot PHP-FPM does not use the default 9000 port permission denied

Source: Internet
Author: User
Tags fpm centos

Today finally have time to think oneself took a set of LNMP development environment, as a result of the previous development environment are the company's existing, the use of the time to change the configuration on the OK, feel very relaxed, but their own hands-on from the installation of virtual machines to the last step to build lnmp, unexpectedly difficult, must be down-to-earth, absolutely can not eyes above the top.

Back to the point, in accordance with the predecessor's blog, step-by-step Yum finished nginx and PHP-FPM, want to use the FASTCGI port for the project instead of the default 90001, the strange things appear

[root@localhost ~]# Service php-fpm start  
starting php-fpm: [18-nov-2015 22:41:44] error:unable to bind listening Soc Ket for address ' 127.0.0.1:9001 ': Permission denied (a)
[18-nov-2015 22:41:44] ERROR:FPM
                                                           initialization failed [FAILED]

Obviously is the root user, obviously 9001 port is not occupied, how does not have the authority. Baffled

The reason is that SELinux is enabled in the CentOS kernel

[Root@localhost ~]# Cat/etc/sysconfig/selinux # This file controls to the state of SELinux on the    

system.
# selinux= can take one of these three values:
#     Enforcing-selinux The security policy is enforced.
#     Permissive-selinux Prints warnings instead of enforcing.
#     Disabled-no SELinux policy is loaded.
Selinux=enforcing
#SELINUX =disabled
# selinuxtype= can take one of these two values:
#     targeted- Targeted processes are protected,
#     Mls-multi level security protection.

Change the selinux=enforcing to selinux=disabled and reboot the system.

What is SELinux. When to enable SELinux and when not.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.