ok, allora accertati che getuid_sid($sid) e $mid siano definiti e facci sapere