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