Background
I am developing a web app with a standard LAMP stack. I am new to web development and had originally planned on simply FTP-ing my code (once completed) to my hosting provider (currently BlueHost, but may change in the future).
Sphinx Search
Recently, I decided to add advanced search functionality to my site powered by Sphinx search. Obviously this meant that I had to install Sphinx to my development machine. When it comes time for the site to go live I am going to have to install (via ssh) Sphinx on my production server. This could require a lot of time debugging subtle differences in the development and production installations of Sphinx (and the rest of the environment for that matter).
I'm Still Learning
I have stumbled upon virtual machines and it looks like (correct me if I'm wrong) some developers create VM's for each project and load the VM onto their production server. This keeps them from having to debug their code once it is uploaded to their production server, thus, increasing the probably for success.
The Question
My question is this: Would it make sense to develop on a virtual machine and attempt to load that onto my production server when app development is complete? If so, can this typically be done for shared servers or only for dedicated servers? If not, would you mind explaining what your opinion of the best way to solve the potential problem of having differences between your development and production servers.