1--TEST-- 2FPM: Test multi pool (dynamic + ondemand + static) (bug #68423) 3--SKIPIF-- 4<?php include "skipif.inc"; ?> 5--FILE-- 6<?php 7 8include "include.inc"; 9 10$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; 11$port1 = 9000+PHP_INT_SIZE; 12$port2 = 9001+PHP_INT_SIZE; 13$port3 = 9002+PHP_INT_SIZE; 14 15$cfg = <<<EOT 16[global] 17error_log = $logfile 18[pool_dynamic] 19listen = 127.0.0.1:$port1 20ping.path = /ping 21ping.response = pong-dynamic 22pm = dynamic 23pm.max_children = 5 24pm.start_servers = 2 25pm.min_spare_servers = 1 26pm.max_spare_servers = 3 27[poold_ondemand] 28listen = 127.0.0.1:$port2 29ping.path = /ping 30ping.response = pong-on-demand 31pm = ondemand 32pm.max_children = 2 33pm.process_idle_timeout = 10 34[pool_static] 35listen = 127.0.0.1:$port3 36ping.path = /ping 37ping.response = pong-static 38pm = static 39pm.max_children = 2 40EOT; 41 42$fpm = run_fpm($cfg, $tail); 43if (is_resource($fpm)) { 44 fpm_display_log($tail, 2); 45 try { 46 var_dump(strpos(run_request('127.0.0.1', $port1), 'pong-dynamic')); 47 echo "Dynamic ok\n"; 48 } catch (Exception $e) { 49 echo "Dynamic error\n"; 50 } 51 try { 52 var_dump(strpos(run_request('127.0.0.1', $port2), 'pong-on-demand')); 53 echo "OnDemand ok\n"; 54 } catch (Exception $e) { 55 echo "OnDemand error\n"; 56 } 57 try { 58 var_dump(strpos(run_request('127.0.0.1', $port3), 'pong-static')); 59 echo "Static ok\n"; 60 } catch (Exception $e) { 61 echo "Static error\n"; 62 } 63 64 proc_terminate($fpm); 65 stream_get_contents($tail); 66 fclose($tail); 67 proc_close($fpm); 68} 69 70?> 71--EXPECTF-- 72[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d 73[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections 74int(%d) 75Dynamic ok 76int(%d) 77OnDemand ok 78int(%d) 79Static ok 80--CLEAN-- 81<?php 82 $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; 83 @unlink($logfile); 84?> 85