We herein report a versatile and environmentally friendly electrochemical oxidative C–H phosphonylation protocol.