![]() ![]() ![]() ![]() I was quite taken but boy those first few steps were frustrating. He was using Local Lightning and having exhausted most routes I decided to download Local and see if I could see what they were doing differently to us. So back in March/April I was helping to debug a problem where something wasn’t running correctly on our hosting but was in the client’s local environment. Ask me 5 years ago should you use XAMPP or MAMP and I would have told you “no”, now I say use what works for you, just be aware the results might be different. While a strong believer, I have been mellowing that thought, and if you are not running weird modules or unusual setups, differences will not affect running code. That said there are always differences, even two sites on the same container can have quirky differences. I am a strong believer that your testing environment should be as close in terms of setup as your live environment. I use the same vagrant template when testing and experimenting with new features for the Hosting Platform. For my personal site, I use a vagrant install with a duplicate copy of the Managed WordPress Hosting containers. I’m quite happy spinning up a vagrant box for doing local development and I work for a hosting company so when it comes to spinning up areas to experiment with I have that covered. And for those that do like to tinker, like me, there is a whole world opened up by exploring Local’s SSH capabilities.I know my way around computers, I think that’s a fair statement, my machine has Virtual Machines and docker instances running. For this reason alone I’m ok to take a small performance hit for something that just works. Local’s use of VMs under the hood does slow down website responses however it’s unlikely that I’ll ever run into the conflict issues I was experiencing with Valet. I will say it’s nice to use something that just works out of the box. Next install Oh My Zsh and now this is beginning to feel like home once again. Alternatively add /usr/bin/zsh to the bottom of ~/.bashrc and reopen SSH and it should be running ZSH. Without knowing Local’s root password chsh -s $(which zsh) fails to make ZSH the default shell. ZSH can be installed by running apt install zsh. A one liner like apt install curl git git-core iputils-ping takes care of those applications. Luckily new software can easily be added by running apt update & apt upgrade then apt install. None of the common commands like curl, git or ping come preinstalled. PRETTY_NAME="Debian GNU/Linux 8 (jessie)" ![]() Running cat /etc/os-release reveals it’s a Linux machine running Debian. You can see the VM running in the background by opening up VirutalBox.Įach site then spins up a new docker on the VM which can be accessed with SSH. Local installs VirtualBox so that it can run a virtual machine which is used to host it’s local websites. Ln -s /usr/share/zoneinfo/America/New_York /etc/localtime What is the underlying virtual machine? In order to correct I made a backup of the current localtime file and created a symlink to my timezone. Local’s default is Etc/UTC however it should really be in sync with the host computer. Running dpkg-reconfigure -frontend noninteractive tzdata will reveal the current zone info. Running date "+%Y-%m-%d %H:%M:%S" on both my command line and the VM’s revealed the difference. I figured this was due to the fact that the VM was running a different time then my local computer. Constellix started to response with the error: Bad timestamp! The timestamp is either expired or in the future. My WordPress website makes API requests to other services like Constellix. With my WordPress site I changed localhost to 192.168.95.1 and which resolved that issue. On MacOs run ifconfig and look for the vboxnet0 adaptor. That request is going fail with Local due to the fact that localhost and 127.0.0.1 reference the virtual machine not the host machine.Ī workaround I came up with involves finding the host machine’s virtual IP. Let’s say your WordPress site needs to make a request to localhost:8000 for another service, like Fathom, which is hosted on your local machine. Web request to other locally hosted application will fail. Here is a recap of my first day digging into Local. VMs run slower and add extra complexities as compared to hosting websites with a local Nginx server (like Valet does). It’s one of the reasons I was avoiding using Local. Local by Flywheel works by using a virtual machine. Spending my day attempting to resolve an obscure bug with Valet is not a good use of my time. However after wasting a day attempting to fix a bug with Valet I decided to give Local by Flywheel a try. I’m a big fan of Laravel’s Valet for local WordPress development. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |