启动php-fpm
systemctl start php74-php-fpm
关闭php-fpm
systemctl stop php74-php-fpm
找到配置文件位置:
ps -ef |grep php
[root@VM-0-6-centos nginx]# ps -ef|grep php
root 3059 1 0 May02 ? 00:00:00 php-fpm: master process (/etc/opt/remi/php74/php-fpm.conf)
apache 3060 3059 0 May02 ? 00:00:11 php-fpm: pool www
apache 3061 3059 0 May02 ? 00:00:11 php-fpm: pool www
apache 3062 3059 0 May02 ? 00:00:12 php-fpm: pool www
apache 3063 3059 0 May02 ? 00:00:12 php-fpm: pool www
apache 3064 3059 0 May02 ? 00:00:12 php-fpm: pool www
apache 3115 3059 0 May02 ? 00:00:11 php-fpm: pool www
apache 4637 3059 0 May02 ? 00:00:11 php-fpm: pool www
apache 6917 3059 0 May02 ? 00:00:07 php-fpm: pool www
apache 7050 3059 0 May02 ? 00:00:08 php-fpm: pool www
apache 7051 3059 0 May02 ? 00:00:08 php-fpm: pool www
配置php-fpm
vi /etc/opt/remi/php74/php-fpm.d/www.conf
1.把listen 处改成端口,这样所有ip都可以
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 9000
2. 修改运行的ip
; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
; accepted from any ip address.
; Default Value: any
listen.allowed_clients = 127.0.0.1,1.2.3.4,5.6.7.8 (改成自己ip,多个ip用逗号隔开)