如何在运行Ubuntu 12.04和PHP 5.4的流浪盒上安装APC?

时间:2013-01-11 22:45:06

标签: php ubuntu apc chef vagrant

在我的“Vagrant”文件中,我有这一行:

chef.add_recipe("php::module_apc")

但它给了我这个错误:

[2013-01-11T22:14:53+00:00] INFO: Processing package[php-apc] action install (php::module_apc line 34)
================================================================================
Error executing action `install` on resource 'package[php-apc]'
================================================================================
Chef::Exceptions::Exec
----------------------
apt-get -q -y install php-apc=3.1.7-1 returned 100, expected 0

Resource Declaration:
---------------------
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/php/recipes/module_apc.rb

 33: when "debian"
 34:   package "php-apc" do
 35:     action :install
 36:   end
 37: end

Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/php/recipes/module_apc.rb:34:in `from_file'

package("php-apc") do
  retry_delay 2
  retries 0
  recipe_name "module_apc"
  action [:install]
  cookbook_name :php
  package_name "php-apc"
end
[2013-01-11T22:14:53+00:00] ERROR: Running exception handlers
[2013-01-11T22:14:53+00:00] ERROR: Exception handlers complete
[2013-01-11T22:14:53+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2013-01-11T22:14:53+00:00] FATAL: Chef::Exceptions::Exec: package[php-apc] (php::module_apc line 34) had an error: Chef::Exceptions::Exec: apt-get -q -y install php-apc=3.1.7-1 returned 100, expected 0
Chef never successfully completed! Any errors should be visible in the output above. Please fix your recipes so that they properly complete.

我之前也在运行这个:

chef.add_recipe("apt")

但它也没有帮助。

任何想法如何解决这个问题?非常感谢!

顺便说一下,我正在使用OpsCode的所有食谱: https://github.com/opscode-cookbooks/

1 个答案:

答案 0 :(得分:2)

module_apc.rb更改;

apt-get install php-apc

......来:

apt-get install php5-apc