nginx和fastcgi的通信方式有两种
1、TCP:# 1、nginx location ~ \.php$ { index index.php index.html index.htm; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } # 2、php-fpm listen=127.0.0.1:90002、unix domain socket:
# 1、新建fpm-cgi.sock sudo touch /dev/shm/fpm-cgi.sock sudo chown www-data:www-data /dev/shm/fpm-cgi.sock sudo chmod 666 /dev/shm/fpm-cgi.sock # 2、php-fpm listen=/dev/shm/fpm-cgi.sock listen.backlog = -1 # 3、nginx location~\.php