Despite the prevalent use of Drosophila as a model in studies of nutrition, the effects of fundamental food properties, such as pH, on animal health and behavior are not well known. We examined the effect of food pH on adult Drosophila lifespan, feeding behavior, and microbiota composition and tested the hypothesis that pH-mediated changes in palatability and total consumption are required for modulating longevity. We measured the effect of buffered food (pH 5, 7, or 9) on male gustatory responses (proboscis extension), total food intake, and male and female lifespan. The effect of food pH on germfree male lifespan was also assessed. Changes in fly-associated microbial composition as a result of food pH were determined by 16S ribosomal RNA gene sequencing. Male gustatory responses, total consumption, and male and female longevity were additionally measured in the taste-defective Pox neuro (Poxn) mutant and its transgenic rescue control. An acidic diet increased Drosophila gustatory responses (40-230%) and food intake (5-50%) and extended survival (10-160% longer median lifespan) compared with flies on either neutral or alkaline pH food. Alkaline food pH shifted the composition of fly-associated bacteria and resulted in greater lifespan extension (260% longer median survival) after microbes were eliminated compared with flies on an acidic (50%) or neutral (130%) diet. However, germfree flies lived longer on an acidic diet (5-20% longer median lifespan) compared with those on either neutral or alkaline pH food. Gustatory responses, total consumption, and longevity were unaffected by food pH in Poxn mutant flies. Food pH can directly influence palatability and feeding behavior and affect parameters such as microbial growth to ultimately affect Drosophila lifespan. Fundamental food properties altered by dietary or drug interventions may therefore contribute to changes in animal physiology, metabolism, and survival.