1.php-fpm的配置文件
根据命令找到路径修改配置文件
ps -ef|grep php-fpm
vim /home/php/etc/php-fpm.conf
;;;;;;;;;;;;;;;;;;; Global Options ;;;;;;;;;;;;;;;;;;;[global]pid = run/php-fpm.piderror_log = log/error.logdaemonize = yeslog_level = warning;syslog.facility = daemon;syslog.ident = php-fpm; golbal max fork processprocess.max = 100;child reuse timeoutprocess_control_timeout = 10s;emergency_restart_threshold = 0;emergency_restart_interval = 60s;process.priority = -19;rlimit_files = 1024;rlimit_core = 0;systemd_interval = 10; Specify the event mechanism FPM will use. The following is available:; - select ????(any POSIX os); - poll ??????(any POSIX os); - epoll ?????(linux >= 2.5.44); - kqueue ????(FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0); - /dev/poll ?(Solaris >= 7); - port ??????(Solaris >= 10); Default Value: not set (auto detection)events.mechanism = epoll;;;;;;;;;;;;;;;;;;;;; Pool Definitions ; ;;;;;;;;;;;;;;;;;;;;[oracle]prefix = /home/phpuser ??= oraclegroup ?= dba;listen.owner = oracle;listen.group = dba;listen.mode = 0660;listen = 127.0.0.1:9000listen = /tmp/php-cgi.socklisten.backlog = 2048 ; Default Value: anylisten.allowed_clients = 127.0.0.1; Choose how the process manager will control the number of child processes. Possible Values:; ??static ?- a fixed number (pm.max_children) of child processes;; ??dynamic - the number of child processes are set dynamically based on the; ?ondemand - no children are created at startup. Children will be forked whenpm = dynamic;pm is `static` onlypm.max_children = 100pm.start_servers = 20pm.min_spare_servers = 10pm.max_spare_servers = 20;pm.status_path = /statuspm.max_requests = 3000pm.process_idle_timeout = 300s;php max_block timeoutrequest_terminate_timeout = 120srlimit_files = 10240catch_workers_output = yes;access.log = var/log/access.log;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%";slowlog = var/log/slow.log;request_slowlog_timeout = 300s ?;chroot = ;chdir = /var/www;ping.path = /ping;ping.response = pong ;Default Value: .php;security.limit_extensions = .php .php3 .php4 .php5 ;Default Value: clean envenv[HOSTNAME] = $HOSTNAMEenv[PATH] = /usr/local/bin:/usr/bin:/bin:/home/php/binenv[TMP] = /tmpenv[TMPDIR] = /tmpenv[TEMP] = /tmpphp_admin_value[memory_limit] = 256M;php_flag[display_errors] = off;php_admin_flag[log_errors] = on;php_admin_value[error_log] = /var/log/fpm-php.www.log;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
2.php.ini的配置
extension_dir = /home/php/lib/php/extensions/no-debug-zts-20121212extension = phalcon.soextension = memcache.soextension = mongo.soextension = xwebxsvc.soextension = imagick.soextension = mysqli.so;;zend_extension = opcache.so;;extension = xwebphp.so[xwebxsvc]xwebxsvc.UdpMultiIp = 239.0.1.1xwebxsvc.UdpMultiPort = 0xwebxsvc.LocalWeight = 8xwebxsvc.RemoteServices = cgi.fix_pathinfo = 1memory_limit = 128M;***** Added by go-pearinclude_path="/home/php:";*****auto_append_file = Noneallow_url_fopen = Onfile_uploads = Onupload_tmp_dir = /tmp/uploadsupload_max_filesize = 50Mpost_max_size = 50Mmax_input_time = 300max_execution_time = 300date.timezone = PRC[opcache]opcache.enable=1opcache.enable_cli=0opcache.fast_shutdown=0;;16Mopcache.memory_consumption=16opcache.interned_strings_buffer=8opcache.max_accelerated_files=4000opcache.revalidate_freq=60[session];;use memcached-1.0.5;;handler => files("/tmp/sess") or memcached("localhost:11210");;session.save_handler = memcached;;session.save_path = "localhost:11210"session.save_handler = memcachesession.save_path = "tcp://localhost:11210;tcp://localhost:11211;tcp://localhost:11212";;session.auto_start = 1;;480==8hourssession.cache_expire = 480session.use_cookies = 1;;use memcached: set cookie_path null!session.cookie_path = /;;gc_maxlifetime=>8hourssession.cookie_lifetime = 28800session.gc_maxlifetime = 28800session.gc_probability = 1session.gc_divisor = 100session.use_only_cookies = 1session.use_trans_sid = 1[mysqli]mysqli.default_socket = /opt/zbox/tmp/mysql/mysql.sock
PHP-FPM 的工作整理
原文地址:https://www.cnblogs.com/wanglijun/p/8696097.html