Global environmental change is altering the patterns of biodiversity worldwide. Observation and theory suggest that species' distributions and abundances depend on a suite of processes, notably abiotic filtering and biotic interactions, both of which are constrained by species' phylogenetic history. Models predicting species distribution have historically mostly considered abiotic filtering and are only starting to integrate biotic interaction. However, using information on present interactions to forecast the future of biodiversity supposes that biotic interactions will not change when species are confronted with new environments. Using bacterial microcosms, we illustrate how biotic interactions can vary along an environmental gradient and how this variability can depend on the phylogenetic distance between interacting species.