and delivered him out of all his afflictions, and gave him favor and wisdom before Pharaoh, king of Egypt, who appointed him governor over Egypt and all his house.