Understanding strongly correlated quantum systems is a central problem in many areas of physics. The collective behaviour of interacting particles gives rise to diverse fundamental phenomena such as confinement in quantum chromodynamics, electron fractionalization in the quantum Hall regime and phase transitions in unconventional superconductors and quantum magnets. Such systems typically involve massive particles, but optical photons can also interact with one another in a nonlinear medium. In practice, however, such interactions are often very weak. Here we describe a technique that enables the creation of a strongly correlated quantum gas of photons using one-dimensional optical systems with tight field confinement and coherent photon trapping techniques. The confinement enables the generation of large, tunable optical nonlinearities via the interaction of photons with a nearby cold atomic gas. In its extreme, we show that a quantum light field can undergo fermionization in such one-dimensional media, which can be probed via standard photon correlation measurements.