iPhone error 40 is an error that usually occurs when you're trying to restore your phone via iTunes. This error indicates that there is a hardware issue.
Some of the solutions to this error include testing your iPhone hardware and using Sn0wbreeze.
Please see our in-depth walk-through solutions below.
If your iPhone screen has no display but the backlight is still functioning, it is usually a sign that your iPhone could not boot. When you attempt to restore it in iTunes, iPhone error 40 may occur. This problem could be caused by a damaged firmware or a damage NAND chip (storage device). Please, try to restore your device by using Device Firmware Update (DFU) reinstall the firmware.
Restore the device using Device Firmware Update Mode
If DFU is not successful bring your phone to an Apple service center for warranty. If it is out of warranty, please bring it to a mobile phone repair shop that could repair a chip-level problem.
NOTE: If your iPhone has undergone a jailbreak, please check Solution 2.
NOTE: This is not recommended by Apple, use it at your own risk.