Photo- and electroproduction of eta, eta-prime mesons on protons are investigated within a relativistic chiral unitary approach based on coupled channels. The s wave potentials for electroproduction and meson-baryon scattering are derived from a chiral effective Lagrangian which includes the eta-prime as an explicit degree of freedom and incorporates important features of the underlying QCD Lagrangian such as the axial U(1) anomaly. The effective potentials are iterated in a Bethe-Salpeter equation and cross sections for eta, eta-prime photo- and electroproduction from protons are obtained. The results for the eta-prime photoproduction cross section reproduce the appearance of an S_(11) resonance around 1.9 GeV observed at ELSA. The inclusion of electromagnetic form factors increases the predicted eta electroproduction cross sections, providing a qualitative explanation for the hard form factor of the photocoupling amplitude observed at CLAS.