11月30日任務php
12.21 php-fpm的poollinux
12.22 php-fpm慢執行日誌nginx
12.23 open_basedirvim
12.24 php-fpm進程管理curl
12.21 php-fpm的poolphp-fpm
[www]
listen = /tmp/www.sock
listen.mode=666
user = php-fpm
group = php-fpm
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024測試
#操做過程url
[root@zgxlinux-01 zhangguoxiang.com]# cd /usr/local/php-fpm/etc/
[root@zgxlinux-01 etc]# ls
pear.conf php-fpm.conf php-fpm.conf.default php.ini
[root@zgxlinux-01 etc]# cat php-fpm.conf
[global]
pid = /usr/local/php-fpm/var/run/php-fpm.pid
error_log = /usr/local/php-fpm/var/log/php-fpm.log
[www]
listen = /tmp/php-fcgi.sock
#listen = 127.0.0.1:9000
listen.mode = 666
user = php-fpm
group = php-fpm
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024spa
[root@zgxlinux-01 etc]# vim !$
vim php-fpm.confunix
[root@zgxlinux-01 etc]# /usr/local/php-fpm/sbin/php-fpm -t
[02-Dec-2018 19:50:12] NOTICE: configuration file /usr/local/php-fpm/etc/php-fpm.conf test is successful
[root@zgxlinux-01 etc]# /etc/init.d/php-fpm reload
Reload service php-fpm done
[root@zgxlinux-01 etc]# ps aux |grep php-fpm
root 6870 0.1 0.4 227324 4964 ? Ss 19:51 0:00 php-fpm: master process (/usr/local/php-fpm/etc/php-fpm.conf)
php-fpm 6871 0.0 0.4 227264 4704 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6872 0.0 0.4 227264 4704 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6873 0.0 0.4 227264 4704 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6874 0.0 0.4 227264 4704 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6875 0.0 0.4 227264 4708 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6876 0.0 0.4 227264 4708 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6877 0.0 0.4 227264 4708 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6878 0.0 0.4 227264 4708 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6879 0.0 0.4 227264 4712 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6880 0.0 0.4 227264 4712 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6881 0.0 0.4 227264 4712 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6882 0.0 0.4 227264 4712 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6883 0.0 0.4 227264 4712 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6884 0.0 0.4 227264 4712 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6885 0.0 0.4 227264 4712 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6886 0.0 0.4 227264 4712 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6887 0.0 0.4 227264 4712 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6888 0.0 0.4 227264 4712 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6889 0.0 0.4 227264 4712 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6890 0.0 0.4 227264 4712 ? S 19:51 0:00 php-fpm: pool www
php-fpm 6891 0.0 0.4 227264 4708 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6892 0.0 0.4 227264 4708 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6893 0.0 0.4 227264 4708 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6894 0.0 0.4 227264 4708 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6895 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6896 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6897 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6898 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6899 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6900 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6901 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6902 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6903 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6904 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6905 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6906 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6907 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6908 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6909 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
php-fpm 6910 0.0 0.4 227264 4716 ? S 19:51 0:00 php-fpm: pool zhangguoxiang.con
root 6936 0.0 0.0 112720 984 pts/0 R+ 19:53 0:00 grep --color=auto php-fpm
[root@zgxlinux-01 vhost]# vim aaa.com.conf
[root@zgxlinux-01 vhost]# ls
aaa.com.conf ld.conf proxy.conf ssl.conf test.com.conf
[root@zgxlinux-01 vhost]# cd /usr/local/php-fpm/etc/
[root@zgxlinux-01 etc]# ls
pear.conf php-fpm.conf php-fpm.conf.default php.ini
[root@zgxlinux-01 etc]# vim php-fpm.conf #添加include = etc/php-fpm.d/*.conf,而後刪除下邊內容,拆分開來。
[root@zgxlinux-01 etc]# vim php-fpm.conf
[root@zgxlinux-01 etc]# mkdir php-fpm.d
[root@zgxlinux-01 etc]# cd php-fpm.d/
[root@zgxlinux-01 php-fpm.d]# vim www.conf
[1]+ 已中止 vim www.conf
[root@zgxlinux-01 php-fpm.d]# fg
vim www.conf
[root@zgxlinux-01 php-fpm.d]# vim zhangguoxiang.conf
[root@zgxlinux-01 php-fpm.d]# ls
www.conf zhangguoxiang.conf
[root@zgxlinux-01 php-fpm.d]# cat ../php-fpm.conf
[global]
pid = /usr/local/php-fpm/var/run/php-fpm.pid
error_log = /usr/local/php-fpm/var/log/php-fpm.log
include = etc/php-fpm.d/*.conf
[root@zgxlinux-01 php-fpm.d]# /usr/local/php-fpm/sbin/php-fpm -t
[02-Dec-2018 20:15:15] NOTICE: configuration file /usr/local/php-fpm/etc/php-fpm.conf test is successful
[root@zgxlinux-01 php-fpm.d]# /etc/init.d/php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm done
[root@zgxlinux-01 php-fpm.d]# ps aux |grep php-fpm
root 7131 0.0 0.4 227352 4976 ? Ss 20:16 0:00 php-fpm: master process (/usr/local/php-fpm/etc/php-fpm.conf)
php-fpm 7132 0.0 0.4 227292 4712 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7133 0.0 0.4 227292 4712 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7134 0.0 0.4 227292 4712 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7135 0.0 0.4 227292 4712 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7136 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7137 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7138 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7139 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7140 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7141 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7142 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7143 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7144 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7145 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7146 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7147 0.0 0.4 227292 4720 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7148 0.0 0.4 227292 4720 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7149 0.0 0.4 227292 4720 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7150 0.0 0.4 227292 4720 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7151 0.0 0.4 227292 4720 ? S 20:16 0:00 php-fpm: pool www
php-fpm 7152 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7153 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7154 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7155 0.0 0.4 227292 4716 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7156 0.0 0.4 227292 4720 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7157 0.0 0.4 227292 4720 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7158 0.0 0.4 227292 4720 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7159 0.0 0.4 227292 4720 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7160 0.0 0.4 227292 4720 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7161 0.0 0.4 227292 4720 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7162 0.0 0.4 227292 4720 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7163 0.0 0.4 227292 4724 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7164 0.0 0.4 227292 4724 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7165 0.0 0.4 227292 4724 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7166 0.0 0.4 227292 4724 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7167 0.0 0.4 227292 4724 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7168 0.0 0.4 227292 4724 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7169 0.0 0.4 227292 4724 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7170 0.0 0.4 227292 4724 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
php-fpm 7171 0.0 0.4 227292 4724 ? S 20:16 0:00 php-fpm: pool zhangguoxiang.conf
root 7183 0.0 0.0 112720 984 pts/0 R+ 20:16 0:00 grep --color=auto php-fpm
12.22 php-fpm慢執行日誌
request_slowlog_timeout = 1
slowlog = /usr/local/php-fpm/var/log/www-slow.log
12.23 open_basedir
12.24 php-fpm進程管理