The consumer price index, a main gauge of inflation, was up 0.5 percent yearly in July, slightly higher than the 0.2 percent increase in June.