We consider a reconfigurable intelligent surface (RIS)-aided massive multi-user multiple-input multiple-output (MIMO) communication system with transceiver hardware impairments (HWIs) and RIS phase noise. Different from the existing contributions, the phase shifts of the RIS are designed based on the long-term angle information. Firstly, an approximate analytical expression of the uplink achievable rate is derived. Then, we use genetic algorithm (GA) to maximize the sum rate and the minimum date rate. Finally, we show that it is crucial to take HWIs into account when designing the phase shift of RIS.