0

when using chef 11.4.0 on an ubuntu 10.04 with the php cookbook (version 1.2.2). I am getting an error

RuntimeError: Package PEAR not found in either PEAR or PECL.

The relevant recipe code is as follows

php_pear "PEAR-drush" do
  package_name "PEAR"
  version "1.9.1"
  action :upgrade
end

I get this same error with any pear package I try to install.

How can I resolve this issue?

Michael Bopp
  • 656
  • 1
  • 4
  • 13
  • Downgrading to the php cookbook 1.1.4 seems to solve the issue. I tried a few of the later versions with the same problem. So I don't know if there is something I am doing wrong or if it's simply a bug in the cookbook recipes. – Michael Bopp Jul 26 '13 at 14:08
  • Shouldn't it be working without "PEAR"? Like that: `php_pear "drush" do version "1.9.1" actiion :upgrade end` – Draco Ater Jul 27 '13 at 00:27

1 Answers1

1

You're trying to install a package named PEAR, which doesn't exist.

There are two ways to indicate to the php_pear resource which package to install. The first one (shorter) is by setting the resource name to the name of the package you want to install:

php_pear "drush" do # Set the package name here
  version "1.9.1"
  action :upgrade
end

And the second one is using the package_name attribute, like you're trying to do, but pointing it to the wrong package:

php_pear "install PEAR package drush" do
  package_name "drush" # Set the package name here
  version "1.9.1"
  action :upgrade
end

Note: The php_pear resource is case-sensitive, so make sure that the package name casing is correct.

cassianoleal
  • 2,556
  • 19
  • 22