We report the realization of a synthetic magnetic field for photons and polaritons in a honeycomb lattice of coupled semiconductor micropillars. A strong synthetic field is induced in both the s and p orbital bands by engineering a uniaxial hopping gradient in the lattice, giving rise to the formation of Landau levels at the Dirac points. We provide direct evidence of the sublattice symmetry breaking of the lowest-order Landau level wavefunction, a distinctive feature of synthetic magnetic fields. Our realization implements helical edge states in the gap between n=0 and n=1 Landau levels, experimentally demonstrating a novel way of engineering propagating edge states in photonic lattices. In light of recent advances in the enhancement of polariton-polariton nonlinearities, the Landau levels reported here are promising for the study of the interplay between pseudomagnetism and interactions in a photonic system.