指定ディレクトリ配下を一覧表示するのに
わざわざ再帰とかありえない
WINの場合はdirだったか?find部分をおきかえれ

$path = dirname(__FILE__);
echo str_replace($path,"",shell_exec("find ".$path));