The model based on Elman neural network (NN) with fruit fly optimization algorithm (FOA) is proposed to forecast the short-term photovoltaic (PV) power. By using the dynamic recurrent of Elman NN, the reasoning and generalization capacity of PV power forecasting model would be enhanced, at the same time, the accuracy of forecasting results ensured. Through introducing the human body amenity to reduce the number of input vectors and using the FOA to train the Elman NN, which can make full use of the global optimization performance of FOA, and overcome the defects such as local optimal solution, slow convergence speed and complex programming. Finally, in comparison with the simulation results of Elman NN, the numerical results verify the effectiveness and correctness of the proposed model and improved algorithm.