方案1,开启upstream(php-fpm)日志。通过日志查看处理请求的脚本文件路径。
php-fpm.d/www.conf
access.log = /var/log/$pool.access.log
tail -f path_to_access.log
- - 13/Apr/2021:14:05:07 +0800 "POST /index.php" 200
- - 13/Apr/2021:14:09:52 +0800 "POST /index.php" 200
方案2,通过进程调试工具
sudo strace -p pid
strace: Process 28880 attached
accept(10,
{sa_family=AF_UNIX}, [112->2]) = 4
poll([{fd=4, events=POLLIN}], 1, 5000) = 1 ([{fd=4, revents=POLLIN}])
times({tms_utime=1388, tms_stime=1099, tms_cutime=0, tms_cstime=0}) = 1336709044
read(4, "\1\1\0\1\0\10\0\0", 8) = 8
read(4, "\0\1\0\0\0\0\0\0", 8) = 8
read(4, "\1\4\0\1\4U\3\0", 8) = 8
read(4, "\17DSCRIPT_FILENAME/data/HQ/SC_Edu"..., 1112) = 1112
read(4, "\1\4\0\1\0\0\0\0", 8) = 8
lstat("/data/www/public/st/mn/dst.php", 0x7ffce98d7170) = -1 ENOENT (No such file or directory)
stat("/data/www/public/st/mn", 0x7ffce98d9580) = -1 ENOENT (No such file or directory)
stat("/data/www/public/st", 0x7ffce98d9580) = -1 ENOENT (No such file or directory)
stat("/data/www/public", {st_mode=S_IFDIR|0774, st_size=4096, ...}) = 0
...