The lnmp environment installed by centOS7.2 and yum is a tough task. Nginx is compiled and installed in the usrlocalnginx directory. Current problems: 1. the service is started normally through servicenginxstart and servicephp-fpmstart, and everything is disabled normally, but no... the lnmp environment installed by centOS7.2 and yum is a tough task.
Nginx is compiled and installed in the/usr/local/nginx directory.
Current problems:
1. service nginx start and service php-fpm start are enabled normally. if the function is disabled normally, but the php file cannot be found, file not found is used as long as php files are accessed, and static files are accessed normally. There is no error in the configuration file. See 2.
2. directly start php-fpm through the/usr/local/nginx/sbin/nginx, that is, the executable file, and access to any page is normal.
3. the most strange thing is that directly opened via nginx can only be closed through kill or nginx-s stop, but cannot be closed through service or systemctl, you can use nginx-s stop to disable the service. The same is true for 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
Who can save the trouble? it's been a whole day.
I suspect it may be a problem with user permissions, but I don't know much about the details, and I'm totally overwhelmed.
Reply content:
The lnmp environment installed by centOS7.2 and yum is a tough task.
Nginx is compiled and installed in the/usr/local/nginx directory.
Current problems:
1. service nginx start and service php-fpm start are enabled normally. if the function is disabled normally, but the php file cannot be found, file not found is used as long as php files are accessed, and static files are accessed normally. There is no error in the configuration file. See 2.
2. directly start php-fpm through the/usr/local/nginx/sbin/nginx, that is, the executable file, and access to any page is normal.
3. the most strange thing is that directly opened via nginx can only be closed through kill or nginx-s stop, but cannot be closed through service or systemctl, you can use nginx-s stop to disable the service. The same is true for 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
Who can save the trouble? it's been a whole day.
I suspect it may be a problem with user permissions, but I don't know much about the details, and I'm totally overwhelmed.
Fixed the issue of selinux permission. the php-fpm access was intercepted. You can disable 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 is in the nginx installation directory/etc/nginx. conf.