I have moved to using VirtualBox VM’s for my local web development. I use Vagrant and Ansible to set them up. For my site, I use synced folders to share the site files from the local machine to the dev VM. This limits what permissions can be set on the files though, and doesn’t work well for Symfony’s var
folder stuff, eg cache and logs. The normal Symfony permissions for those folders use ACL’s, but those cannot be set on Vagrant synced files. My solution was to create a /var/www/var
folder to store such folders for any sites on the VM, and symlink them into place in the shared folder location. I did this with Ansible so that it would be reproducible. Since I ran into some issues getting it working, I thought I’d blog about it.
development posts
Vagrant network IP change
Apparently, an update to VirtualBox after version 6.1.26 limited the IP’s usable for network adapters on Mac / Linux hosts. They must now be in the 192.68.56.0/21
range, which is pretty limited and much less easy to remember or type than the 10.*.*.*
that I had been using. I had to change my projects to all be in this range and spread out the IPs to avoid collisions between the various projects when I updated VirtualBox a while back.
git: MacOS default branch now “main”?
At some point recently, git init
on my Mac has started to default to the branch name “main”. It did this for a repo I created today, but not for one created August 29th, so maybe Apple made a change in an update sometime between then and now. I haven’t been able to find anything about the change on the web though.
I updated to Mac OS Monterey (12.5) finally. It went smoothly but I’m still working through getting some of my dev software updated and working.
Continue reading post "#3780"Swap file for composer out of memory problems
PHP’s defacto package manager, composer, has long required large amounts of memory to do updates for larger projects, often more than servers or virtual machines have. The script will die with an out of memory error, or more recently, the simple message “Killed”, and do no work in these situations. The normal procedure is to develop locally, deploy local lock file (composer.lock
) to the server, and run composer install
instead of update
. But I’ve recently moved to doing most of my development in VMs, so I have had to work around this problem to get things installed or updated. A swap file is the solution for Linux machines provided in the official docs and expanded in a StackOverflow answer.
JS: ES Modules and Node bare specifiers via response rewrite
I’ve been playing with JS lately, including ES modules and building with Rollup, Babel, and Terser, along with other accessories. One thing I’m disappointed with of ES modules in the Nodejs ecosystem is dealing with third party imports. Using the “bare” specifiers that Node expects works fine in that environment and thus tools running in it (possibly needing helpers), but they don’t work at all directly in the browser. This is discussed in this post by Jake Archibold, for instance.
Import maps are one solution in the works, but that requires explicitly mapping every dependency, which could get complicated fast when dependencies have dependencies. It also is only in draft stage and only works in Blink based browsers currently.
I eventually gave in to the idea of having server code rewrite the paths in the js file responses to point to a symlinked node_modules
folder, similar to what is mentioned in this post by the Polymer project. I created a PHP test server for one of my projects that does this.
I made it through the first week of working from home during this virus-caused lockdown.
Continue reading post "#2746"I had a bit of a scare at work today, thinking that a site that accepts credit card payments was allowing them to go through without running the charge through the payment gateway.
Continue reading post "#2567"A tale of bulk email system woes
This past week, my coworker and I had to deal with stressful problems with Cogneato‘s bulk email / newsletter system.
Continue reading post "A tale of bulk email system woes"Kind of a late night working getting a messed up newsletter send back on track.
Continue reading post "#2031"