We determine all the commuting solutions of the quadratic matrix equation AXA = XAX, which can be expressed in terms of projection matrices. All such solutions have special structures and their building blocks satisfy a system of matrix equations, and our general result extends the previous ones in J. Math. Anal. Appl. 402 (2013), 567-573, Applied Math. Lett. 35 (2014), 86-89, Applied Math. Lett. 64 (2017), 231-234, and Applied Math. Lett. 79 (2018), 155-161