exec("ps auxwww|grep sample.php|grep -v grep", $output);
This would only work, though, if PHP is running in CGI mode. If it's running as a SAPI type thing, you'll never see "sample.php" in the process list, just 'httpd'.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…