The contamination of Aspergillus flavus and subsequent aflatoxins (AFs) has been considered as one of the most serious food safety problems due to their acute and chronic adverse effects on humans and animals. This review collects the available information from recent years on the effect of the major environmental factors such as water activity (aw), temperature, CO2, and pH on the fungal growth, the expression of AFs-related genes, and AFs production by A. flavus on foods. In particular, the relationship between the relative expression of key regulatory (aflR and aflS) and structural genes (aflD, aflO, aflQ, etc.) and AFs production under different environmental conditions are collected and discussed. The information collected in this review can be used to design control strategies of A. flavus and AFs contamination in practical applications, primarily during storage and processing. These data suggest that integrating various post-harvest methods with synergistic functions may be more efficient for the control of A. flavus growth and AFs production, although the individual environmental factors alone have an impact.