Centos-nginx and php-fpm startup problems (non-startup failure)

Source: Internet
Author: User
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.

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.