我的 Amazon Linux 上有一个 PHP 文件,看起来像
<?php
sleep(600);
我通过点击公开可用的 URL 来运行文件。 当文件运行时,我运行
ps aux
在我的 Linux 盒子上,但我无法从列表中找到相应的进程。 我也试过
ps ax | grep *.php
不返回任何结果。
为什么我找不到我的 PHP 进程?
只需发出此命令
ps aux | grep php
不要发出*.php
我刚刚在我的盒子上做了ps aux | grep php
,我得到了以下输出
ps aux | grep php
root 6156 0.0 0.1 189700 4128 pts/9 T 12:00 0:00 sudo emacs MissionAgreement.php -nw
root 6168 0.1 0.4 252820 16864 pts/9 T 12:00 0:02 emacs MissionAgreement.php -nw
gain-dev 6387 0.0 0.1 230632 4640 ? Sl 12:13 0:00 /usr/lib64/libreoffice/program/oosplash --writer /var/www/html/wwwroot/phpword/samples/gain_docx_template/MissionAgreement_.docx
gain-dev 6400 4.1 6.0 1515164 237840 ? Sl 12:13 0:45 /usr/lib64/libreoffice/program/soffice.bin --writer /var/www/html/wwwroot/phpword/samples/gain_docx_template/MissionAgreement_.docx --splash-pipe=6
gain-dev 6869 0.0 0.0 103252 828 pts/9 S+ 12:32 0:00 grep php
root 20355 0.0 0.0 189700 8 pts/9 T Dec19 0:00 sudo emacs Invoice.php -nw
root 20483 0.0 0.0 252612 8 pts/9 T Dec19 0:01 emacs Invoice.php -nw
gain-dev 29811 0.0 0.2 404620 10492 ? S Dec18 1:54 gedit /home/gain-dev/.cache/.fr-HxN35J/index.php
root 30741 0.0 0.0 189704 8 pts/0 T Dec16 0:00 sudo emacs gain_fns.php -nw
root 30743 0.0 0.0 252288 8 pts/0 T Dec16 0:00 emacs gain_fns.php -nw
root 31164 0.0 0.0 189700 8 pts/0 T Dec16 0:00 sudo emacs /etc/php.ini -nw
root 31174 0.0 0.0 250640 8 pts/0 T Dec16 0:00 emacs /etc/php.ini -nw
root 31380 0.0 0.0 189704 8 pts/0 S Dec16 0:00 sudo emacs mission_insert.php -nw
root 31382 0.0 0.3 252664 12464 pts/0 S+ Dec16 0:01 emacs mission_insert.php -nw
如果上面的示例是一个问题,您也可以启用 mod_status 扩展状态 打开将显示当前正在处理的 pid 和 URL。你会得到一个很好的输出和这个网址上的例子:http://www.apache.org/server-status