The season-opening game was close throughout, typical of the regular-season and playoff battles these powerhouse teams have fought in recent years.
San Antonio's Tim Duncan had a wide-open look at a three-pointer in the closing seconds, but it bounced off the rim and the Spurs had to foul Barbosa. His free throws wrapped up a victory for Porter in his first regular-season appearance since replacing Mike D'Antoni.
Spurs Coach Gregg Popovich embarked on his 13th season with the team, having led San Antonio to the playoffs 11 straight years and to the NBA title four times.
Amare Stoudemire paced Phoenix with 22 points, Barbosa had 18 and Shaquille O'Neal scored 15.
Duncan and Tony Parker led the Spurs with 32 each.