1

I never worked with Chef and OpsWorks before. What I'm doing, I'm trying to overwrite some Chef conf to use modern PHP 5.6.

I wrote a JSON for Layer PHP App Server

{ "mod_php5_apache2": { "packages": ["php56-xml", "php56-common", "php56-gd", "php56-bcmath", "php56-mysqlnd", "php56-pecl-memcache"], "version": "2.4" } , "php-mysql" : {"package_name" :"php56-mysqlnd" } }

And it started installing a new PHP version and packages. But I have problem with php-mysql. I found this file: https://github.com/aws/opsworks-cookbooks/blob/release-chef-11.4/mod_php5_apache2/recipes/mysql_adapter.rb As I understood it provides an php-mysql package name, so I tried to overload it in JSON and it didn't work. When I'm deploying the layer (setup), it fails due to packages conflict:


[2016-05-18T20:28:25+00:00] INFO: Processing package[php56-mysqlnd] action install (mod_php5_apache2::default line 4)
[2016-05-18T20:28:25+00:00] DEBUG: package[php56-mysqlnd] checking yum info for php56-mysqlnd
[2016-05-18T20:28:25+00:00] DEBUG: package[php56-mysqlnd] installed version: (none) candidate version: 5.6.21-1.124.amzn1
[2016-05-18T20:28:25+00:00] INFO: package[php56-mysqlnd] installing php56-mysqlnd-5.6.21-1.124.amzn1 from amzn-updates repository
[2016-05-18T20:28:25+00:00] DEBUG: Executing yum -d0 -e0 -y install php56-mysqlnd-5.6.21-1.124.amzn1
[2016-05-18T20:28:28+00:00] DEBUG: ---- Begin output of yum -d0 -e0 -y install php56-mysqlnd-5.6.21-1.124.amzn1 ----
[2016-05-18T20:28:28+00:00] DEBUG: STDOUT: 
[2016-05-18T20:28:28+00:00] DEBUG: STDERR: 
[2016-05-18T20:28:28+00:00] DEBUG: ---- End output of yum -d0 -e0 -y install php56-mysqlnd-5.6.21-1.124.amzn1 ----
[2016-05-18T20:28:28+00:00] DEBUG: Ran yum -d0 -e0 -y install php56-mysqlnd-5.6.21-1.124.amzn1 returned 0
[2016-05-18T20:28:28+00:00] INFO: Processing package[php56-pecl-memcache] action install (mod_php5_apache2::default line 4)
[2016-05-18T20:28:28+00:00] WARN: Problem parsing line 'Plugin "replace" can't be imported' from yum-dump.py! Please check your yum configuration.
[2016-05-18T20:28:28+00:00] DEBUG: package[php56-pecl-memcache] checking yum info for php56-pecl-memcache
[2016-05-18T20:28:28+00:00] DEBUG: package[php56-pecl-memcache] installed version: 3.0.8-6.17.amzn1 candidate version: 3.0.8-6.17.amzn1
[2016-05-18T20:28:28+00:00] DEBUG: package[php56-pecl-memcache] is already installed - nothing to do
[2016-05-18T20:28:28+00:00] INFO: Processing package[php-mysql] action install (mod_php5_apache2::mysql_adapter line 1)
[2016-05-18T20:28:28+00:00] DEBUG: package[php-mysql] checking yum info for php-mysql
[2016-05-18T20:28:28+00:00] DEBUG: package[php-mysql] installed version: (none) candidate version: 5.3.29-1.8.amzn1
[2016-05-18T20:28:28+00:00] INFO: package[php-mysql] installing php-mysql-5.3.29-1.8.amzn1 from amzn-main repository
[2016-05-18T20:28:28+00:00] DEBUG: Executing yum -d0 -e0 -y install php-mysql-5.3.29-1.8.amzn1
[2016-05-18T20:28:30+00:00] DEBUG: ---- Begin output of yum -d0 -e0 -y install php-mysql-5.3.29-1.8.amzn1 ----
[2016-05-18T20:28:30+00:00] DEBUG: STDOUT:  You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[2016-05-18T20:28:30+00:00] DEBUG: STDERR: Error: php56-pdo conflicts with php-pdo-5.3.29-1.8.amzn1.x86_64
Error: php-mysql conflicts with php56-mysqlnd-5.6.21-1.124.amzn1.x86_64
Error: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
[2016-05-18T20:28:30+00:00] DEBUG: ---- End output of yum -d0 -e0 -y install php-mysql-5.3.29-1.8.amzn1 ----
[2016-05-18T20:28:30+00:00] DEBUG: Ran yum -d0 -e0 -y install php-mysql-5.3.29-1.8.amzn1 returned 1

================================================================================
Error executing action `install` on resource 'package[php-mysql]'
================================================================================


Chef::Exceptions::Exec
----------------------
returned 1, expected 0
---- Begin output of  ----
STDOUT:  You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigestSTDERR: Error: php56-pdo conflicts with php-pdo-5.3.29-1.8.amzn1.x86_64
Error: php-mysql conflicts with php56-mysqlnd-5.6.21-1.124.amzn1.x86_64
Error: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
---- End output of  ----



Resource Declaration:
---------------------
# In /opt/aws/opsworks/releases/20160503163349_2426-20160503163349/cookbooks/mod_php5_apache2/recipes/mysql_adapter.rb

1: package 'php-mysql' do
2:   package_name value_for_platform_family(
3:     'rhel' => 'php-mysql',
4:     'debian' => 'php5-mysql'
5:   )
6: end



Compiled Resource:
------------------
# Declared in /opt/aws/opsworks/releases/20160503163349_2426-20160503163349/cookbooks/mod_php5_apache2/recipes/mysql_adapter.rb:1:in `from_file'

package("php-mysql") do
retry_delay 2
version "5.3.29-1.8.amzn1"
retries 0
cookbook_name :mod_php5_apache2
recipe_name "mysql_adapter"
action :install
package_name "php-mysql"
end

Is there a any way to overload those deprecated packages?

  • 1) did you make any progress 2) with the json specified does this force php 5.6 to be installed instead of 5.5.9? – Paul Preibisch Aug 22 '16 at 22:47
  • 1. I had to spend a lot of time trying to fix that. But I fixed it doing patching original opsworks cookbook. You can specify our repository and give it a try github.com/Localvox/opsworks-chef-cookbooks There are a few changes for templates etc. 2. Yes. It will install php-56. – zoonman Aug 23 '16 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.