I find that there are two contradicting factors at play here:
On removing proton, negative charge on oxygen is more stable than it is on nitrogen (because of greater electronegativity of oxygen). Therefore, phenol is more acidic than aniline.
+M effect of oxygennitrogen is more in phenol than +M effect of nitrogenoxygen, so negative charge (after deprotonation) in the case of aniline will be more delocalized making the anion more stable. This makesTherefore, aniline should be more acidic than phenol.
So is that a factual question or am I missing something?