If you are aspiring for a PhD programme or want a LOR for post-doctoral research, you should ideally ask your master's project guide or PhD guide to be one of the referees for your letter of recommendation for PhD students. Referees should be academicians with whom you have worked or someone who has supervised or taught you. PhD is purely an academic degree and therefore you need to have a recommendation letter for PhD from those who can vouch for your academic inclination and strengths. Before asking someone for a recommendation letter for PhD application, you should know whom to ask.