0

We are running on php 5.4.44 with CentOS 6.7 I was reading some comments found here: https://www.reddit.com/r/PHP/comments/2w7xok/does_anyone_know_where_i_can_find_a_chef_cookbook/

How could I go about installing php 5.6 on CentOS 6.7 using chef? I have not gotten into chef that much so I'm a bit lost, but I know php 5.4 will be reaching its end of life Or would it be recommended that we change to CentOS 7? I've been trying to research but I really can't find something.

I also read this: Upgrading PHP on CentOS 6.5 (Final)

Is there any more information I have to post? Or am I asking the wrong question please let me know.

Community
  • 1
  • 1
mxlfa
  • 95
  • 8

1 Answers1

1

You need to do a few things:

  1. Find a repo containing the PHP version you want, such as the IUS repos
  2. Using Chef, add that repo to your server
  3. Using Chef, set node['php']['packages'] to be the package names that are appropriate for that repo
  4. Then call the chef php cookbook like usual

For example, when I do the steps above, to get to php55 from the default, I do:

default['php']['packages'] = %w(
    php55u
    php55u-devel
    php55u-mcrypt
    php55u-mbstring
    php55u-gd
    php55u-pear
    php55u-pecl-memcache
    php55u-gmp
    php55u-mysqlnd
    php55u-xml )

And then including the upstream/community php recipe. Your biggest challenge will be finding a package repo for PHP 5.6, I'd imagine. It looks like IUS only goes up to php 5.6, but webtatic has it.

You may encounter other issues if PHP 5.6 is extremely different in architecture, but that'll get you pretty far. It looks like upstream's php cookbook can also build from source, but I'd avoid that unless you absolutely need it.

Martin
  • 2,815
  • 1
  • 21
  • 30