My PhD situation is giving me anxiety attacks. Is quitting (and losing 2 years) my only option?
1- First, you would not be losing 2 years. In those 2 years, you learned things and developed your skills. In your current mental health state, it is probably hard to view this experience as positive, but I suggest you give it a try. Maybe make a list of the skills and experience you gained with your PhD.

2- Get professional help, as stated in the comments. Once you feel a bit better, you'll be ready to take a decision.

3- I get the feeling that most of your reasons to stay are linked with advisor-related guilt (funding, no publication, no reference for future work). You would be surprised, but most advisors are human, and did a PhD. He/She can probably understand your problems and help you reach a decision. Maybe he/she could even suggest some ideas to reduce your guilt (quit the program, but write an article on the side or help another person to pick up where you left).

If your advisor is not human (which, seems to happen sometimes), there's probably a department head that could mediate discussion between you and your advisor about quitting the program. But you need to discuss with your advisor.

Good luck and take care.