Here, I'm not sure you must do a database query to build the path.

Something such as:

$rs = execute("$main::imscpConfig{'CMD_RM'} $main::ispcpConfig{'PHP_STARTER_DIR'}/*/php5-fcgi-starter");
...

Should do the job as well.