Knicks owner James Dolan has fired president Phil Jackson, who had been feuding with star players Carmelo Anthony and Kristaps Porzingis just as free agency is about to begin.

Jackson had made it clear that he intended to deal one of the stars, but Dolan stepped in, grabbed control of the team and ended Jackson’s disastrous front-office stint.

In three seasons under Jackson, the Knicks went 80-166 as Jackson — in his first-ever front office job — rebuilt the roster three times.

Jackson earned $60 million for the job, or roughly $50,000 per day.

Dolan hired Jackson to fix a losing culture at Madison Square Garden, but he only made it worse, in the end alienating Anthony, who refused to waive his no-trade clause, and Porzingis, who was so disgusted that he skipped his exit meeting at the end of the season.

Jackson, according to reports, began fielding offers for Porzingis.

Jackson’s firing means the NBA offseason may just be more exciting than its regular season.

Will the Knicks still buy out Carmelo Anthony, opening up the door for a move to the Cavaliers and LeBron James’ team? Or, with Jackson gone, will Anthony orchestrate a trade to the Sixers or Wizards or decide to stay?