Dull questions for web development nerds
I’d like to take a moment, if I may, to run some work I’m doing by the web application developers out there. If you’re not one, feel free to skip this post.
I’ve got a number of different websites on the go right now, including a few in development. Most of these sites include at least one web application rooted in PHP and MySQL. Traditionally, I’ve done my building and design on the live site itself, but lately I’ve finally gotten into the much better habit of working offline and uploading the finished files afterwards. If you want to get technical, my website hosts are running a LAMP software bundle, and the offline environments I’m running at home and at the office are based on WAMP software bundles.
Here’s the main question. So far, I’ve gotten into the habit of creating and updating PHP files offline, but I haven’t moved or exported any of my live SQL databases. Back when I was doing all the work in my hosted space, I could obviously just tell my PHP files to look for a database on the localhost. But that doesn’t work when you run those files on another server, like the one I’ve set up at home.
The way I see it, I’ve got two options, and I’m currently weighing the pros and cons of each one. On the one hand, I could create local copies of all the relevant SQL databases on my development servers. If I did so, then the “localhost” reference would work in any environment. But it would mean having two copies of my databases, each of which would contain different data before too long. That seems like a giant mess in the making.
On the other hand, I could replace the “localhost” value with my server’s IP address, and configure remote access from my home and work environments. I’d have only one version of my data that way, but I’d have to go through the trouble of setting up the proper permissions. This might not even be a practical solution at home, where my ISP assigns me a new address with every new connection.
What do you think? Are there pros and cons I haven’t taken into account here? Is there a third option I’m not seeing? What’s the best way to manage all of this? It might even end up being a situation where I take one approach with some sites and the other approach with the rest, which would be a little tougher to manage, but at least I’d know I’m doing what’s best for each individual site.
If you made it all the way to the end of this post, then I congratulate you and thank you, and I’d like to know where you think I ought to go from here.
Posted in Uncategorized