the son of an egyptian , he had lived the first nine years of his life on the banks of the nile , but was taken away by raiders , and sold into slavery at philistia , where he lived the next six years , eventually becoming the servant to a high-ranking officer .