How to upgrade my iphone 4 to ios7. I'm currently using ios6?

I try updating it over the air and i got an error messages. And i got same problem when updating using iTunes. My iTunes is up to date.

What was the error message?

Download the latest version of itunes and install it on your computer. Then connect your iphone and click restore and update button. The internet connection must not be too slow.