public
Created

APC and XDebug not installing using Chef and Vagrant

  • Download Gist
Vagrantfile
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# -*- mode: ruby -*-
# vi: set ft=ruby :
 
Vagrant::Config.run do |config|
config.vm.box = "precise32"
config.vm.network :hostonly, "33.33.33.10"
config.vm.network :bridged
config.vm.forward_port 80, 8080
config.vm.share_folder "web-app", "/web-app", "web-app"
 
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.add_recipe("build-essential")
chef.add_recipe("apt")
chef.add_recipe("apache2")
chef.add_recipe("apache2::mod_php5")
chef.add_recipe("php")
chef.add_recipe("web-app")
end
end
default.rb
Ruby
1
include_recipe "web-app::webserver"
errors
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
# XDebug installation error
[2013-01-09T09:24:28+00:00] INFO: Processing php_pear_channel[pear.php.net] action update (php::default line 25)
[2013-01-09T09:24:29+00:00] INFO: Processing php_pear_channel[pecl.php.net] action update (php::default line 29)
[2013-01-09T09:24:30+00:00] INFO: Processing php_pear_channel[pear.php.net] action update (web-app::webserver line 5)
[2013-01-09T09:24:30+00:00] INFO: Processing php_pear_channel[pecl.php.net] action update (web-app::webserver line 10)
[2013-01-09T09:24:30+00:00] INFO: Processing php_pear[xdebug] action install (web-app::webserver line 15)
[2013-01-09T09:24:38+00:00] INFO: Installing php_pear[xdebug] version 2.2.1
[2013-01-09T09:25:41+00:00] ERROR: Running exception handlers
[2013-01-09T09:25:41+00:00] ERROR: Exception handlers complete
[2013-01-09T09:25:41+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
 
# APC installation error
[2013-01-09T09:45:40+00:00] INFO: Processing php_pear[apc] action install (web-app::webserver line 11)
 
================================================================================
 
Error executing action `install` on resource 'php_pear[apc]'
 
================================================================================
 
 
RuntimeError
 
------------
 
Package apc not found in either PEAR or PECL.
 
 
Cookbook Trace:
---------------
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/php/providers/pear.rb:259:in `pecl?'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/php/providers/pear.rb:107:in `load_current_resource'
 
Resource Declaration:
---------------------
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/web-app/recipes/webserver.rb
 
10: package "libpcre3-dev"
11: php_pear "apc" do
12: action :install
13: end
14:
 
Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/web-app/recipes/webserver.rb:11:in `from_file'
 
php_pear("apc") do
retry_delay 2
preferred_state "stable"
retries 0
recipe_name "webserver"
action [:install]
cookbook_name :"web-app"
package_name "apc"
end
 
[2013-01-09T09:48:21+00:00] ERROR: Running exception handlers
[2013-01-09T09:48:21+00:00] ERROR: Exception handlers complete
[2013-01-09T09:48:21+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2013-01-09T09:48:21+00:00] FATAL: RuntimeError: php_pear[apc] (web-app::webserver line 11) had an error: RuntimeError:
Package apc not found in either PEAR or PECL.
webserver.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
app_name = 'web-app'
app_config = node[app_name]
 
# install the xdebug pecl
php_pear "xdebug" do
action :install
end
 
# install the apc pecl
package "libpcre3-dev" # is needed for APC
php_pear "apc" do
action :install
end
 
# Set up the Apache virtual host
web_app app_name do
server_name app_config['server_name']
docroot app_config['docroot']
template "#{app_name}.conf.erb"
log_dir node['apache']['log_dir']
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.