A search for a Higgs boson decaying into two photons is described. The analysis is performed using a dataset recorded in 2011 by the CMS experiment at the LHC from pp collisions at a centre-of-mass energy of 7~TeV, and corresponds to an integrated luminosity of 4.8~fb. Limits are set on the cross section of the fermiophobic model Higgs boson decaying to two photons. The expected exclusion limit at 95\% confidence level increases monotonically between 0.1 and 3.0 times the fermiophobic model cross section in the mass range between 110 and 150~GeV, while the expected exclusion range is below 136~GeV. The observed limit excludes at 95\% confidence level the fermiophobic model Higgs boson decaying into two photons in the mass range 110 to 124~GeV and 128-136~GeV. The largest excess of events over the expected background is observed around 126~GeV. The excess has a local significance of 2.7~. When taking in consideration the look-elsewhere effect in the search range 100150~GeV, the global significance is 1.2~. More data are required to ascertain the origin of this excess.