Centos-nginx and PHP-FPM startup issues (non-bootable)

Source: Internet
Author: User
Encounter a very painful thing, centos7.2,yum installation of the LNMP environment.
Nginx is compiled and installed and placed in the/usr/local/nginx directory.
Current problems encountered:
1, through the service Nginx start and service php-fpm start normal, shut down what is normal, but cannot find PHP file, as long as the PHP file access is file not found, access to static files normal. The configuration file is completely error-free, visible 2.
2, through the/usr/local/nginx/sbin/nginx, that is, the executable file directly started, the same direct start php-fpm, so no problem, access to any page is normal.
3, the most bizarre, through the Nginx directly open only through kill or nginx-s stop shutdown, cannot be closed through the service or SYSTEMCTL, and through the service can be turned off through nginx-s stop. The same is true of PHP-FPM.
As follows:

  [root@vikie-pc web]# ps-ef |grep phproot 4988 1 0 16:24?        00:00:00 Php-fpm:master process (/etc/php-fpm.conf) www 4989 4988 0 16:24?        00:00:00 php-fpm:pool wwwwww 4990 4988 0 16:24?        00:00:00 php-fpm:pool wwwwww 4991 4988 0 16:24?        00:00:00 php-fpm:pool wwwwww 4992 4988 0 16:24?        00:00:00 php-fpm:pool wwwwww 4993 4988 0 16:24?        00:00:00 php-fpm:pool wwwroot 5020 1 0 16:25?        00:00:00 Php-fpm:master process (/etc/php-fpm.conf) www 5028 5020 0 16:25?        00:00:00 php-fpm:pool wwwwww 5030 5020 0 16:25?        00:00:00 php-fpm:pool wwwwww 5032 5020 0 16:25?        00:00:00 php-fpm:pool wwwwww 5033 5020 0 16:25?        00:00:00 php-fpm:pool wwwwww 5035 5020 0 16:25? 00:00:00 php-fpm:pool wwwroot 5231 27194 0 16:25 pts/1 00:00:00 grep--color=auto php  

O Heaven, who can save for the whole day.
I suspect that it might be a problem with user rights, but I don't know much about it.

Reply content:

Encounter a very painful thing, centos7.2,yum installation of the LNMP environment.
Nginx is compiled and installed and placed in the/usr/local/nginx directory.
Current problems encountered:
1, through the service Nginx start and service php-fpm start normal, shut down what is normal, but cannot find PHP file, as long as the PHP file access is file not found, access to static files normal. The configuration file is completely error-free, visible 2.
2, through the/usr/local/nginx/sbin/nginx, that is, the executable file directly started, the same direct start php-fpm, so no problem, access to any page is normal.
3, the most bizarre, through the Nginx directly open only through kill or nginx-s stop shutdown, cannot be closed through the service or SYSTEMCTL, and through the service can be turned off through nginx-s stop. The same is true of PHP-FPM.
As follows:

  [root@vikie-pc web]# ps-ef |grep phproot 4988 1 0 16:24?        00:00:00 Php-fpm:master process (/etc/php-fpm.conf) www 4989 4988 0 16:24?        00:00:00 php-fpm:pool wwwwww 4990 4988 0 16:24?        00:00:00 php-fpm:pool wwwwww 4991 4988 0 16:24?        00:00:00 php-fpm:pool wwwwww 4992 4988 0 16:24?        00:00:00 php-fpm:pool wwwwww 4993 4988 0 16:24?        00:00:00 php-fpm:pool wwwroot 5020 1 0 16:25?        00:00:00 Php-fpm:master process (/etc/php-fpm.conf) www 5028 5020 0 16:25?        00:00:00 php-fpm:pool wwwwww 5030 5020 0 16:25?        00:00:00 php-fpm:pool wwwwww 5032 5020 0 16:25?        00:00:00 php-fpm:pool wwwwww 5033 5020 0 16:25?        00:00:00 php-fpm:pool wwwwww 5035 5020 0 16:25? 00:00:00 php-fpm:pool wwwroot 5231 27194 0 16:25 pts/1 00:00:00 grep--color=auto php  

O Heaven, who can save for the whole day.
I suspect that it might be a problem with user rights, but I don't know much about it.

Resolved, for SELinux permissions issue, to put PHP-FPM access blocked. You can either turn on SELinux or add the PHP-FPM service to the SELinux whitelist

If the static page can be accessed, it is estimated that the Nginx configuration file is not configured, the configuration file in the Nginx installation directory/etc/nginx.conf

  • Related Article

    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.