#strace -f -F -o php-cgi-strace /wwwchroot/php/bin/php-cgi --fpm-config /wwwchroot/php/etc/php-fpm.conf
//--接收来自Nginx发出的请求
4510 <... accept resumed> {sa_family=AF_INET, sin_port=htons(35983), sin_addr=inet_addr("127.0.0.1")}, [16]) = 3
4510 clock_gettime(CLOCK_MONOTONIC, {22638545, 869965681}) = 0
4510 poll([{fd=3, events=POLLIN}], 1, 5000) = 1 ([{fd=3, revents=POLLIN}])
4510 read(3, "\1\1\0\1\0\10\0\0",
= 8
4510 read(3, "\0\1\0\0\0\0\0\0",
= 8
4510 read(3, "\1\4\0\1\0035\3\0",
= 8
4510 read(3, "\21\7GATEWAY_INTERFACECGI/1.1\17\5SERV"..., 824) = 824
4510 read(3, "\1\4\0\1\0\0\0\0",
= 8
4510 time(NULL) = 1295425149
//--加载请求资源文件hello.php
4510 lstat64("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
4510 lstat64("/var/www", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
4510 lstat64("/var/www/ep", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
4510 lstat64("/var/www/ep/hello.php", {st_mode=S_IFREG|0644, st_size=119, ...}) = 0
4510 clock_gettime(CLOCK_MONOTONIC, {22638545, 870893872}) = 0
4510 setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={60, 0}}, NULL) = 0
4510 rt_sigaction(SIGPROF, {0x835c120, [PROF], SA_RESTART}, {SIG_DFL, [], 0},
= 0
4510 rt_sigprocmask(SIG_UNBLOCK, [PROF], NULL,
= 0
4510 time(NULL) = 1295425149
4510 open("/var/www/ep/hello.php", O_RDONLY) = 4
4510 fstat64(4, {st_mode=S_IFREG|0644, st_size=119, ...}) = 0
4510 time(NULL) = 1295425149
4510 chdir("/var/www/ep") = 0
4510 fstat64(4, {st_mode=S_IFREG|0644, st_size=119, ...}) = 0
4510 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fe7000
4510 read(4, "\n", 8192) = 29
4510 read(4, "", 8192) = 0
4510 read(4, "", 8192) = 0
4510 close(4) = 0
//-- 加载hello.inc, 对应php代码include './hello.inc'
4510 getcwd("/var/www/ep"..., 4096) = 12
4510 time(NULL) = 1295425149
4510 open("/var/www/ep/hello.inc", O_RDONLY) = 4
4510 fstat64(4, {st_mode=S_IFREG|0644, st_size=29, ...}) = 0
4510 read(4, "\n", 8192) = 29
4510 read(4, "", 8192) = 0
4510 read(4, "", 8192) = 0
4510 close(4) = 0
4510 time(NULL) = 1295425149
//-- 加载hello.inc, 对应php代码include DOCUMENT_ROOT . '/hello.inc'
4510 lstat64("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
4510 lstat64("/var/www", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
4510 lstat64("/var/www/ep", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
4510 lstat64("/var/www/ep/hello.inc", {st_mode=S_IFREG|0644, st_size=29, ...}) = 0
4510 open("/var/www/ep/hello.inc", O_RDONLY) = 4
4510 fstat64(4, {st_mode=S_IFREG|0644, st_size=29, ...}) = 0
4510 read(4, "\n", 8192) = 29
4510 read(4, "", 8192) = 0
4510 read(4, "", 8192) = 0
4510 close(4) = 0
//-- 将响结果输出给Nginx,并且关闭连接
4510 write(3, "\1\6\0\1\0V\2\0X-Powered-By: PHP/5.2.10"..., 96) = 96
4510 setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0
4510 write(3, "\1\3\0\1\0\10\0\0\0\0\0\0\0ere", 16) = 16
4510 shutdown(3, 1 /* send */) = 0
4510 recv(3, "\1\5\0\1\0\0\0\0", 8, 0) = 8
4510 recv(3, "", 8, 0) = 0
4510 close(3) = 0