I am writing php web applications, and simply deploy them via FTP. To make it work, I often have some tweaking/debugging to do given that I have little control over the (free) web server hosting me, so what's working in my local environment might not work live.
For example I keep a separate php file containing class_db_myapp.php which extends a class_db.php with specific DB parameters : db name, username, password which won't be the same local and live. (For information : Lately I started using git for version control)
As my app evolves, some files get renamed / deleted / created. When comes the time to upload a new version, I have to either rely on my memory to know what I have to upload / delete or simply delete all / upload all. But in the second case I need to avoid erasing the class_db_myapp.php file...
I haven't come up with a proper solution to this.
What are the best practices in this domain?
I may have missed an existing discussion on this subject, if so please point me to it.
Thank you.
If the ftp server supports symbolic links you can use the following technique:
If something went wrong you can easily revert to the previous version by modifying the symlink again.
For database and other settings that are different in the live environment, there are several options: