A French prosecutor ordered on Monday a man who had attacked soldiers with a knife in Lyon to be held in a psychiatric hospital.