When I try open the preview, it saves my file and doesn't work


I’m working with dynamic websites , but when I try to open the preview so it saves the .php file and does not work. When I try to use the browser says that there is an error that does not exist .