He was replaced by lefty Franklin Morales.
Anderson allowed just one hit through the first three innings, but left after throwing one pitch to Arismendy Alcantara. He started bending at the knees before pitching coach Jim Wright, manager Walt Weiss and a trainer came out to the mound.
Anderson gave the ball to Wright and a moment later walked to the dugout while reaching around to his back left leg.
Anderson returned to the rotation on July 13 after missing two months with a broken left index finger. He was 1-1 with a 2.84 ERA in five starts since coming off the disabled list.