Ralf Fahrmann's fine performance was not enough to prevent Porto from beating Schalke to secure top spot in Champions League Group D.