When it has happened to me, it has always been a bad cable. And a bad cable can damage the charging port. There need to be 5 gold pins in the cable end that plugs into the phone. Often one of the pins gets pushed back or breaks off. Inspect the inside of that plug. Never force the plug. If it is...