How do I fix an iPhone that won't charge and keeps turning on and then shutting off?
If your iPhone turns on and then immediately shuts off and won't charge, the battery probably doesn't have enough charge. Try a different known-good cable, a different charger, and a different outlet. If none of that works, the battery has likely reached the end of its life. Take it to an Apple Store or Authorized Apple Service Provider, or contact Apple for mail-in service.