I’m new to having a local copy of a website with MAMP and uploading any changes to the production site (using Coda).
I’m struggling on how I prevent specific local settings (DB, local path etc.) in my PHP files overwriting the production server settings and crashing it?
I’d rather not have to publish a config file to the production site, then go have to update all the settings again for the production environment, but can only guess I have to do it?
Thanks. Yes I had been using the relative paths for the images, which was lucky but I’ve found that I have some problems with the $_SERVER, that I use to reference some resources outside of the web root, being unavoidably very different on both locations.
It was hardcoded when I worked only remotely on the site, but now I find I need to set it for the development site in my config file, then upload to production, then re-edit remotely to fix it for the new server.
Great, thanks guys. I like to keep my sites as ‘portable’ as possible, so as they could be picked up from one host and dropped onto another with very little fuss/downtime etc. I’ve spent years just working on them ‘live’, but trying to take a more considered approach now with development/production stages. :D