I know, in most cases, this problem to be the usb port on the iphone. Unfortunately this part seems to be a part which only one in five of these parts to be good from experience. Either the mic or data port are defective which makes a diy repair frustrating. Most people will change it once they hit a defect part and give up. Don't give up. Trying to help people who are frustrated as I was. Usually occurs when you update with a port having bad contacts and ends up with a no sync or no voice on phone mic. May not be what you want to hear.
Yes it is possible, but consider the consumption and Costs.
How much electricity does it take to power your iPhone for a year?
The answer: 1 kWh.
This is the amount of electricity you’d need to power ten 100-watt incandescent light-bulbs for an hour.
Far from anything worth being sheepish over, 1 kwh costs about 12 cents.
To be specific, your iPhone battery holds a charge of 1,440 mAh, or about 5.45 watt hours. If you fully drained and recharged your phone everyday, then over the course of a year you would have to feed it about 2,000 watt hours, or 2kWh = 25 Cents per Year.
As for your iPad, keeping it fed costs just $1.36 a year, according to the Electric Power Research Institute.
Your average laptop, with its far bigger screen, uses about 72 kWh, costing some $8 a year.
There is your challenge:
Make a power station that has a ROI such to recover the cost using the 25 cents per Year returns.
Answer: if it cost you $20 to make the power station- it will take about 40 Years before you see benefit.
Best Answer
Apple designed the hardware to power on when it detects charging power.
When the operating system is off, the hardware still remains sensitive to the introduction of charging power. Not only does this help in cases where the OS has frozen and run down the battery past the point where available voltage can even run the system (including the charging circuitry) but it also helps in the more common case of "my phone is dead" and I'd like it back without having to press buttons. Depending on how long the battery self-discharged after crossing the "empty" line, it may need tens of seconds or even minutes of charging to get back to the minimum viable voltage. At that point, the sleep/wake button can become effective again for starting the OS.
You can of course plug in the power and then shut off the operating system phone to Charge with the OS halted. The charging circuitry runs whether the OS is running or not, and that circuitry is what kicks the OS to start when the 30 pin, lightning, USB-C or wireless charging commences while the OS is not running.