ps -ef | egrep 'apache|php5' > processes
cat processes | awk '{print"-p " $2}' | xargs sudo strace -f -o strace.out -t &
Linux Ubuntu