If you’ve updated to the newly released MacOS Mojave release then you might find the following issue when starting your vagrant box with NFS mounting:

Preparing to edit /etc/exports. Administrator privileges will be required…

Password:
tee: /etc/exports: Operation not permitted
tee: /etc/exports: Operation not permitted
tee: /etc/exports: Operation not permitted

You can quickly fix this issue by following the following steps:

  1. Open “System Preferences”
  2. Go to “Security & Privacy”
  3. Click the “padlock” icon in the bottom-left corner where it says “Click the lock to make changes” – enter your password when prompted
  4. On the list of permissions on the left, select “Full Disk Access”
  5. Now, on the right-hand side, click the little “+” icon
  6. This will open a browse window, use this to select your preferred Terminal e.g. “Applications > iTerm” or “Applications > Utilities > Terminal”
  7. If the selected Terminal is already open, you’ll be asked to Quit it – quit the application and restart it
  8. When you restart the selected application, you may prompted if you’d like to allow the app to make changes to your computer – accept and enter your password if required
  9. Try mounting your vagrant machine and now the above error should no longer appear!

Note that this is a solution that I have tried and tested, but will be worth keeping an eye out for Vagrant/Virtualbox updates to see if they have an alternative solution.

I normally use PuPHPet to configure my Vagrant boxes.
On my latest box using CentOS 5.6 the setup worked normally, but when trying to run my application I was getting the Class ‘Memcache’ not found error.

Usually this is a simple fix, just go in and type:

sudo yum install -y php-memcached

However, this time round the above was giving me the following error:

Transaction Check Error:
file /usr/lib64/libhashkit.so.2.0.0 conflicts between attempted installs of libmemcached-last-libs-1.0.18-2.el6.remi.x86_64 and libmemcached10-1.0.16-1.ius.centos6.x86_64
file /usr/lib64/libmemcached.so.11.0.0 conflicts between attempted installs of libmemcached-last-libs-1.0.18-2.el6.remi.x86_64 and libmemcached10-1.0.16-1.ius.centos6.x86_64
file /usr/lib64/libmemcachedutil.so.2.0.0 conflicts between attempted installs of libmemcached-last-libs-1.0.18-2.el6.remi.x86_64 and libmemcached10-1.0.16-1.ius.centos6.x86_64

After smashing my head against the desk a few times during numerous attempts at installing the module, reprovisioning the vagrant box and anything else I could think of doing to fix it, I tried something that hadn’t occurred to me before; to install the dependency it was complaining about first.

Using the following commands fixed my issue, and should also work for you:

sudo yum install -y libmemcached-last
sudo yum install -y php-memcached
sudo service php-fpm restart

Hope this helps!

I just came across an issue where I updated my vagrant config and tried to provision the box, but it kept erroring out with the following error:

==> default: Error: printf "\\n" | pecl -d preferred_state=stable install pecl_http returned 1 instead of one of [0]
==> default: Error: /Stage[main]/Puphpet_php/Puphpet::Php::Pecl[pecl_http]/Php::Pecl::Module[pecl_http]/Exec[pecl-pecl_http]/returns: change from notrun to 0 failed: printf "\\n" | pecl -d preferred_state=stable install pecl_http returned 1 instead of one of [0]
==> default: Warning: /Stage[main]/Puphpet_php/Service[php5-fpm]: Skipping because of failed dependencies

In order to fix this I logged into the server using SSH, and then manually ran the install pecl_http command that it was trying to run in the above error message.  In doing so I got a different error:

$ sudo pecl -d preferred_state=stable install pecl_http
pecl/pecl_http requires package "pecl/raphf" (version >= 1.1.0), installed version is 1.0.4
No valid packages found
install failed

It turns out that a pecl dependency was out of date and so it couldn’t install the pecl_http package.  In order to fix it I just ran the pecl upgrade command.

vagrant up
vagrant ssh
sudo pecl upgrade

After running the above, I tried my vagrant provision again, and hey presto! Everything was working again as normal