Try putting your phone into DFU mode. To do that press and hold down both the Power and Home buttons until you see the Apple logo. After it appears, let go of the power button and keep holding down the Home button until you see a screen that says to connect to iTunes. Plug it into your computer and it should say that your phone is in restore mode. Click on Restore and see if that works.
The Lightning port is soldered onto the logic board. Unfortunately, when the port goes bad, you would need to replace the entire phone. Getting a replacement logic board would cost more than the phone itself. Currently, there's no way to repair the Lightning Port short of replacing the entire device.