Before installing, understand the relationship between nginx and php. nginx is like a messaging officer, forwarding requests to php-fpm. This requires knowing the php-fpm contact method. The value of listen is the phone number of php-fpm. When the request comes, nginx calls php-fpm, saying that someone is looking for you, php-fpm sends someone to pick up the guest, and the person who sent it is a php process. Seeing that you believe in cleverness here, you understand that php-fpm is responsible for managing the scheduling of php processes.
Getting started with the configuration
Because it is a personal computer, you can use the apt command directly.
sudo install nginxsudo apt-get install php7.0-fpm php7. 0-mysql php7.0-common php7.0-curl php7.0-cli php7.0-mcrypt php7.0-mbstring php7.0-domMore php module is not bad, save the time to report error, back If the component is missing, you can continue to install it, which is very convenient. If the downloaded source package is compiled by itself, it is more troublesome. You need to install some class libraries first. Everything here is simple, mainly to introduce how nginx and php7 work together. After executing the above two commands, the software is done. First, let's take a look at the php-fpm configuration /etc/php/7.0/fpm/pool.d/www.conf (if it is centos or compile and install, the address of the configuration file will be different), find it in the configuration file. Br>
listen=/run/php/php7.0-fpm.sock# It is also possible that listen=127.0.01:9000No matter what, anyway, remember that listen=what, this is very important, this explains What is fpm listening to? Look at nginx's configuration /etc/nginx/sites-enabled/default, (if it is centos or compile and install, the address of the configuration file will be different), find server{} in the configuration file, this represents you Web hosting. Find
location ~ \\.php$ { include snippets/fastcgi-php.conf; # With php7.0-cgi alone: # fastcgi_pass 127.0.0.1:9000; # With php7.0-fpm: Fastcgi_pass unix:/run/php/php7.0-fpm.sock; }See fastcgi_pass, who will forward the request to whom. Who is it for? You are sure to be smart, that is, the one we listened to in php-fpm above. If php-fpm is listen=/run/php/php7.0-fpm.sock then use fastcgi_pass unix:/run/php/php7.0-fpm.sock in nginx; if php-fpm is listen=127.0 .01:9000 Then use fastcgi_pass 127.0.0.1:9000 in nginx;
Command Save the file and exit :x is equivalent to the following command: :wq Saves the cur
Operating system: Centos6 1.Discover the problem Ping external network packet loss is serious, ping
1. Introduction to Firewalls Firewall Concept Firewalls can filter datagrams and restrict specific s
What is a process? A process is a running instance of an already launched executable. The process ha
Linux mount hard disk error "you must specify the filesystem type"
Do DBA must learn, will not die 11 Linux basic commands
View cpu physics number, core number, logical cpu number under linux
Configuring Internet proxy for Unix and Linux
Linux development environment to build and use - Linux common editor vim
Linux process management notes
Installation of Java, Maven, and Tomcat under Linux
How to add fonts in Linux system
Ubuntu13.04 sets static ip (whether notebook, desktop, virtual machine)
Win7 Ultimate system boot appears "Windows can not find files or no associated programs"
Examples to explain Windows 2003 partition Capacity and
Ghost use precautions under win7
Win8 perfect solution mandatory driver signature
Microsoft released Windows XP SP2 blue screen fix patch
The latest vulnerability attack caused "XP Help" to somehow pop up
Win7/win8.1 quickly get win10 upgrade push notification tips