What did Paul mean by 'work out your salvation'? Therefore, my dear friends, as you have always obeyed—not only in my presence, but now much more in my absence—continue to work out your salvation with fear and trembling. (Philippians 2:12)


Does this mean although a person has accepted Jesus as Lord, they still need to work out their salvation and they might loose it? From the scripture below I took it that salvation is a gift and one does not need to work it out?


  For it is by grace you have been saved, through faith--and this not from yourselves, it is the gift of God-- (Ephesians 2:28)


Can you please explain what Philippians 2:12 means?
Therefore, my dear friends, as you have always obeyed—not only in my presence, but now much more in my absence—continue to work out your salvation with fear and trembling, for it is God who works in you to will and to act in order to fulfill his good purpose. (Philippians 2:12-13, NIV)


The idea of working out our salvation means that it is something we already own but must cooperate with the Holy Spirit if we are to enjoy its full benefits. If we did not already 'have' salvation residing in us, then we would not be able to work it outwards from that place.  The fact is when one enters the 'kingdom of God' it is heaven entering into them. This new life, generated by the Spirit, is called the inner man and the old sinful life inherited from Adam is called the outer.   Now having entered into heaven and heaven into us, we are already considered to be in heaven. To work to enter into heaven is silly because a believer is already in heaven and a full citizen of it:


  And God raised us up with Christ and seated us with him in the heavenly realms in Christ Jesus, in order that in the coming ages he might show the incomparable riches of his grace, expressed in his kindness to us in Christ Jesus. For it is by grace you have been saved, through faith —and this is not from yourselves, it is the gift of God— not by works, so that no one can boast. For we are God’s handiwork, created in Christ Jesus to do good works, which God prepared in advance for us to do. (Ephesians 2:6-10, NIV)


As God is in us, and His presence is heaven, we must be fearful as we approach Him in ourselves.  Not only because he is so great and powerful do we revere him, but because his grace and love has overshadowed us in our sin that we must respect how awesome this salvation is.  The carnal believer will see the word 'work' and quickly loose sight of grace because they have little fear of God's salvation.  Paul counteracts this natural wicked inclination by reminding us that both our holy desire and the strength to carry is out into obedience is properly Gd's work in us and not our own.  

We must be willing cooperators under the influence of the Holy Ghost. The Holy Spirit will not possess us against our wills like a demon, but will fill us with power and desire like wind on a sail. We must just gently swing the sail of our souls into His wind and be blown about, striving under his might with great respect to the magnificence of his gracious power. This will require on our part great sweat and toil for the flesh, Devil and entire world will oppose all of God's works. Any other attitude would be ungrateful, irreverent and lacking in faith.