Agoraphobia, or the anxiety from wide spaces, is really interesting. 
Oh really?  What is interesting about it?
Well it is where the person perceives the environment to be unsafe with no simple way to get away from it.
When you say "the environment" do you mean like in the forest or nature or that kind of thing?  Or just outside?
Any environment, whether its outside or inside. As long as it seems unsafe for them.
So then how do they function in society?  You're basically telling me that they don't go outside at all, right?
They do go outside, but it just has risks involved, like panic attacks.
Is there something they can do to alleviate these panic attacks?
Not really as far as I know. The symptoms can last up to six months or longer and occur in nearly every time they are in this scenario.
I can't imagine risking having a panic attack just by being in any enviroment.  That sounds awful.