How can I best set up my PHP (LAMP) development environment so that I have development, staging and production servers. One-\"click\" deployment to any of those, as well as one
For database changes, we have a directory in the VCS:
+ dbchanges
|_ 01_database
|_ 02_table
|_ 03_data
|_ 04_constraints
|_ 05_functions
|_ 06_triggers
|_ 07_indexes
When you make a change to the database you put the .sql file into the correct directory, and run the integration script that goes through these directories in order, and import every change into the db.
The sql files have to have to start with a comment, which is displayed to the user when the integration scripts imports the change, describing what it does. It logs every imported sql file's name to a file, so when you run the script next time, it won't apply the same change again.
This way, all the developers can simply run the script to get the db up to date.