I'm using Vagrant to bring up a web server for most of my projects but stumbled across an issue where Apache/PHP wasn't able to write to a SQLite database. The solution was to add the following to my Vagrantfile:
config.vm.synced_folder ".", "/vagrant", owner: "www-data", group: "www-data"
That, along with usermod -a -G vagrant www-data within the guest OS, did the trick.