He rescued him out of all his troubles and granted him favor and wisdom before Pharaoh, king of Egypt, who made him governor over Egypt and all his household.