nginx给root权限

2021012923322045.png

php给root权限

1.编辑文件 vi /www/server/php/74/etc/php-fpm.conf
2.设置以下四项
listen.owner = root
listen.group = root
user = root
group = root
3.修改以后如下
[global]
pid = /www/server/php/74/var/run/php-fpm.pid
error_log = /www/server/php/74/var/log/php-fpm.log
log_level = notice

[www]
listen = /tmp/php-cgi-74.sock
listen.backlog = 8192
listen.allowed_clients = 127.0.0.1
listen.owner = root
listen.group = root
listen.mode = 0666
user = root
group = root
pm = dynamic
pm.status_path = /phpfpm_74_status
pm.max_children = 80
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 20
request_terminate_timeout = 100
request_slowlog_timeout = 30
slowlog = var/log/slow.log
4.重启php,需要手动启动,使用宝塔图形化界面启动可能报错
[root@localhost etc]# php-fpm -R

[root@localhost etc]# ps -aux | grep php-fpm
root      13570  0.0  0.1 249732  7452 ?        Ss   23:26   0:00 php-fpm: master process (/www/server/php/74/etc/php-fpm.conf)
root      13571  0.2  0.4 256400 18244 ?        S    23:26   0:01 php-fpm: pool www
root      13572  0.0  0.1 249732  6576 ?        S    23:26   0:00 php-fpm: pool www
root      13573  0.0  0.1 249732  6576 ?        S    23:26   0:00 php-fpm: pool www
root      13574  0.0  0.1 249732  6576 ?        S    23:26   0:00 php-fpm: pool www
root      13575  0.0  0.1 249732  6576 ?        S    23:26   0:00 php-fpm: pool www
root      13587  0.0  0.1 249732  6576 ?        S    23:26   0:00 php-fpm: pool www
root      14087  0.0  0.0 112812   972 pts/1    S+   23:33   0:00 grep --color=auto php-fpm