Breaking up with partners is a terrible feeling, and it has compounded your issue since you've likely lost your closest emotional support at a time when you might rely on them the most. Time will help you with this problem. Meeting new people can be incredible because you find that you experience life in a completely unique and exciting way depending who you share your time with. When you are ready for that again, those opportunities will be there waiting for you.
Concerning your issues from home, Myself and many of my friends included had not realized how much our childhood and family life had affected us until we were well into our 30's. This is true despite having been aware of dysfunctional family issues from a young age. I've also had a number of therapists from my youth and many of them were useless. However, therapy is still the solution for this and I'd like to be clear why this is important to you:
Any close exposure, especially developmental, to narcissists or those with borderline traits can be devastating. The average person is highly ill-equipped to rationalize their experiences with someone of this nature.
I'd recommend you find a specialist in this area. Not all therapists are the same, find one that can work on you, with you. You will need help to disentangle the reality of your youth and you should not have to do it alone. However, you don't have you do this right now. You should focus on counseling for your immediate issues, however you assess them, in order to maintain forward momentum in your life.
Lastly, I am a realist: You can probably do this. All of it. Recover from this emotional deficit, finish your PhD, develop meaningful social relationships, and improve your well being through self discovery. What you are capable of is simply a matter perspective, and remember this is limited when you are so close to the bottom.