General-purpose quantum computers can, in principle, entangle a number of noisy physical qubits to realize composite qubits protected against errors. Architectures for measurement-based quantum computing intrinsically support error-protected qubits and are the most viable approach for constructing an all-photonic quantum computer. Here we propose and demonstrate an integrated silicon photonic scheme that both entangles multiple photons, and encodes multiple physical qubits on individual photons, to produce error-protected qubits. We realize reconfigurable graph states to compare several schemes with and without error-correction encodings and implement a range of quantum information processing tasks. We observe a success rate increase from 62.5% to 95.8% when running a phase-estimation algorithm without and with error protection, respectively. Finally, we realize hypergraph states, which are a generalized class of resource states that offer protection against correlated errors. Our results show how quantum error-correction encodings can be implemented with resource-efficient photonic architectures to improve the performance of quantum algorithms. Entangled photon states can be used to make quantum information more robust. A photonic experimental implementation with eight qubits shows that error-protection schemes can increase the success rate of running a quantum algorithm.