For the gas phase, the fugacity of a species is equal to the fugacity coefficient of the pure species at the same temperature and total pressure as the solution multiplied by the partial pressure, only for an ideal gaseous solution. For a non-ideal solution of gases, the treatment must be more like that of a liquid. Also, the partial pressure of a species is not a directly measurable quantity, and must be calculated as the mole fraction times the total pressure.
Fugacity also comes into play for liquids. For a liquid species in ideal solution below its critical temperature and pressure, the starting point for getting the fugacity of a liquid species is the equilibrium vapor pressure of the pure species at the same temperature. This can be used to determine the fugacity of the same species in the gas phase at the equilibrium vapor pressure. Since, for a pure species, its free energy in the gas phase is equal to the free energy in the liquid phase, this necessarily means that the fugacity of the pure species in the liquid phase at saturation is equal to its fugacity in the gas phase. Therefore, we know the fugacity of the pure species in the liquid at the solution temperature and equilibrium vapor pressure. The fugacity of the pure liquid species can then be calculated at the same temperature and total pressure of the solution by integrating RTdlnf=dp/ρ between the saturation vapor pressure and the total solution pressure, where ρ is the molar density of the liquid (nearly a constant). Then, for an ideal liquid solution, the fugacity can be obtained by multiplied the fugacity of the pure liquid component at the same temperature and pressure of the solution by the mole fraction in the liquid. For non-ideal liquid solutions, however, further correction is necessary involving activity coefficients. See Smith and Van Ness for more details.