I used to have this problem. Check these settings are the same:
O2: If you can't connect to the internet using the O2 network on your iPhone, here's what you need to do.
Go to Settings/General/Network/Cellular Data Network or Mobile Data network and check that Cellular Data/Mobile Data APN, Visual Voicemail APN and MMS APN show as idata.o2.co.uk
Your Username should be vertigo and your Password is password
For picture messaging, you'll need to check -
MMSC =
http://mmsc-ac.mms.o2.co.uk:10021/mmsc
MMSC Proxy = 82.132.254.1:8080
MMS Max Message Size = 2097152
If anything needs changing, just tap on it to edit, copy it in, and you're done. Any other fields aren't needed, so you can ignore them.
Alternatively, if you just want to connect to the internet and you've got a wifi connection, here's a link to download the settings instead -
https://adc.o2.co.uk/apple_ota/83680261136B0006558626A21486/Iphone idata.mobileconfig
I think for mine it was the MMSC settings slightly different either the socket or the URL
Thats what fixed my issue.