Pham, Carpenter homer in Cardinals' victory