Check out the steps mentioned here, I tried those out and worked for me. http://techioguy.com/fix-issue-iphone-not-charging/
open