Non-destructive detection of photonic qubits will enable important applications in photonic quantum information processing and quantum communications. Here, we present an approach based on a solid-state cavity containing an ensemble of rare-earth ions. First a probe pulse containing many photons is stored in the ensemble. Then a single signal photon, which represents a time-bin qubit, imprints a phase on the ensemble that is due to the AC Stark effect. This phase does not depend on the exact timing of the signal photon, which makes the detection insensitive to the time-bin qubit state. Then the probe pulse is retrieved and its phase is detected via homodyne detection. We show that the cavity leads to a dependence of the imprinted phase on the {it probe} photon number, which leads to a spreading of the probe phase, in contrast to the simple shift that occurs in the absence of a cavity. However, we show that this scenario still allows non-destructive detection of the signal. We discuss potential implementations of the scheme, showing that high success probability and low loss should be simultaneously achievable.