Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
litespeed_wiki:php:503-errors [2018/08/01 18:40] Jackson Zhang [Strace the PHP process] |
litespeed_wiki:php:503-errors [2018/08/01 19:12] Lisa Clarke [Strace the PHP process] Proofreading |
||
---|---|---|---|
Line 348: | Line 348: | ||
strace -tt -T -f -p 791228 | strace -tt -T -f -p 791228 | ||
- | Sometimes, it may not be easily to get pid since the PHP may run very quick. In this case, you can try to strace **parent pid**, but the disadvantage of stracing parent pid is you may get too much-unrelated information in strace log and not easily to locate the problem pattern. | + | Sometimes, it may not be easy to get the ''pid'' since the PHP may run very quickly. In this case, you can try to strace the //parent pid//, but the disadvantage of stracing the parent pid is that you may get too much unrelated information in strace log. That would make it difficult to locate the problem pattern. |
- | Alternatively, using a script to catch the pid. It depend on which SuEXEC user your PHP will be running and which script will be running ( such as index.php etc). | + | One solution is to use a script to catch the pid. It depends on which SuEXEC user your PHP will be running and which script will be running ( such as index.php etc). |
| | ||
while true; do if mypid=`ps aux | grep $USERNAME | grep lsphp | grep $SCRIPTNAME | grep -v grep | awk '{print $2; }' | tail -1`; then strace -tt -T -f -p $mypid; fi ; done | while true; do if mypid=`ps aux | grep $USERNAME | grep lsphp | grep $SCRIPTNAME | grep -v grep | awk '{print $2; }' | tail -1`; then strace -tt -T -f -p $mypid; fi ; done | ||
- | **Note**: **$USERNAME** should be replaced by real username; **$SCRIPTNAME** should be replaced by the script name running, such as index.php or other scripts | + | **Note**: ''$USERNAME'' should be replaced with a real username; ''$SCRIPTNAME'' should be replaced by the name of the script that is running, such as ''index.php'' or other scripts. |
==== Enable Core Dump ==== | ==== Enable Core Dump ==== | ||