![]() ![]() Perhaps one site is using PHP 5.6 with MySQL, and another is using PHP 7.1 with MariaDB. Using virtual machines can significantly simplify local development when working on significantly different sites. ![]() VirtualBox is a broadly used, free virtual machine application that runs on macOS, Linux, and Windows. With 8 or 16GB of memory, it’s entirely reasonable to run multiple virtual machines at once without a noticeable slowdown. As hardware extensions for virtualization support and 4GB+ of RAM became standard in workstations, running a full virtual machine for development work (and not just on servers) became reasonable. Virtual machines are actually really old technology-older than Unix itself. However, the usual caveats around battery life and laptop hardware availability for Linux support remain. Everything you do is transferable to production environments, and there are incredible resources online for learning how to set everything up. Running a Linux distribution as your primary operating system is a great way to do local development. And, if you need to install something like the PHP mongodb or redis extensions, it’s straightforward either through the package manager or through pecl. However, once you’ve set up a local this way, you will have immediately transferable skills to production environments. For example, simply running apt install php won’t give you common extensions like gd for image processing. ![]() Instead of one bundle with “everything”, you have to know what you need to install. This is slightly more complicated than an AMP application as it requires the command line instead of using a GUI dashboard. ![]() Windows users have the option of the Linux subsystem now available in Windows 10. Linux users would use apt or yum - which would be similar to setting up on a remote server. For example, Mac users would use Homebrew and Homebrew-PHP to install Apache, PHP, and MySQL. This style of setup involves using the command line to install the appropriate software locally. Finally, the skills you learn won’t apply directly to production environments, or if you change operating systems locally. Sometimes, the configuration they ship with can deviate from your actual server environments, leading to the “it works on my local but nowhere else” problem. If your PHP app requires a PHP extension that’s not included, adding it in by hand can be difficult. However, there are some significant limitations. Simply uninstall and reinstall the app, and you’ll have a clean slate. It’s also the easiest to recover from when things go wrong. This is by far the simplest way to get a local environment up and running for Mac or Windows users. For example, MAMP contains an isolated stack with Apache, PHP, and MySQL compiled for Windows or macOS. In this model, a native application is downloaded and run locally. What’s a developer lead to do? Let's review the options available for 2018! 1. Yet, most junior web developers have little command line experience or have only been exposed to Windows environments in their post-secondary training. Many of these options require a strong, almost expert-level of understanding of *nix systems administration and management. Instead of consolidation, we’ve seen a multitude of good options become available, with no clear “best” choice. Today, I see every new web developer struggle with just keeping their locals running. After all, WAMP was getting to be rather usable and stable on Windows, Linux was beginning to be preinstalled on laptops, and Mac OS X was in its heyday of being the primary focus for Apple. If you’d asked me a decade ago what local setup for web development would look like, I would have guessed “simpler, easier, and turn-key”. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |