All measurements come from interactions. In our macroscopic world, our intuition is that we can observe things without affecting them, but this is not true at quantum scales. In order for that measurement at the slit to happen, the photon has to interact with something — an electron, say — which couples the state of the photon to the state of the detector, which in turn can be read. This coupling destroys the coherence between the two paths through the slits so that they don't interfere.
The idea of wavefunction collapse is a simplification that we use when we are modelling only part of the total system with our equations. For example, it's common to write down a Scrödinger equation for a single particle, but not include a representation for what detects the particle. Such models work fine as long as one remembers to collapse the wavefunction after a measurement event. It's just a model, though, it doesn't represent all of reality.
In general, remember that quantum mechanics is physics, not philosophy. "Observers" get conflated with conscious beings a lot in popular conversation, but that is not how best to understand them. When physicists speak of an abstract observer, it's really a label in a thought experiment to group together certain physical interactions. In the case of wavefunction collapse, the wavefunction is the simplified representation of a small physical system, and the observer is whatever breaks the boundary between the larger world and that system. In this case this is the slit detector, as @Jimnosperm describes.