You didn't say what kind of computer or operating system you have, which makes it harder to make suggestions, but I'll try anyway.
If it is a Windows computer open a command window in Administrator mode (I can't tell you how to do this without knowing the OS) and type:
netsh winsock reset
Then reboot the computer and connect the iPhone. If it still doesn't activate find the hosts file on your computer, and delete any lines that contain gs.apple.com. Again, the procedure for doing this varies with computer type and operating system.