Not now, but long before this time, and presently after the marriage of his daughter, as is most probable; and it is here mentioned only as the occasion of Solomon's building it. Possibly the Canaanites of this place had been guilty of some heinous crime; and because Solomon thought not fit to destroy them himself, he desired Pharaoh to do it for him, or Pharaoh might offer his service herein for his daughter's advantage.
Related Commentaries of 1 Kings 9:16
1 Kings 9:16
16 For Pharaoh king of Egypt had gone up, and taken Gezer, and burnt it with fire, and slain the Canaanites that dwelt in the city, and given it for a present unto his daughter, Solomon's wife.