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