在ec2中安装PHP 7

时间:2019-02-05 21:15:06

标签: php amazon-ec2 chef-recipe

我尝试用Chef安装php 7,但是当我启动实例时出现此错误:

    ================================================================================
Error executing action `install` on resource 'yum_package[php70, php70-devel, php70-cli, php70-bcmath, php70-snmp, php70-soap, php70-xml, php70-xmlrpc, php70-process, php70-mysqlnd, php70-opcache, php70-pdo, php70-imap, php70-mbstring, php70-intl, php70-mcrypt, php70-gd]'
================================================================================

Chef::Exceptions::Exec
----------------------
yum -d0 -e0 -y install php70-7.0.29-1.28.amzn1 php70-devel-7.0.29-1.28.amzn1 php70-cli-7.0.29-1.28.amzn1 php70-bcmath-7.0.29-1.28.amzn1 php70-snmp-7.0.29-1.28.amzn1 php70-soap-7.0.29-1.28.amzn1 php70-xml-7.0.29-1.28.amzn1 php70-xmlrpc-7.0.29-1.28.amzn1 php70-process-7.0.29-1.28.amzn1 php70-mysqlnd-7.0.29-1.28.amzn1 php70-opcache-7.0.29-1.28.amzn1 php70-pdo-7.0.29-1.28.amzn1 php70-imap-7.0.29-1.28.amzn1 php70-mbstring-7.0.29-1.28.amzn1 php70-intl-7.0.29-1.28.amzn1 php70-mcrypt-7.0.29-1.28.amzn1 php70-gd-7.0.29-1.28.amzn1 returned 1:
STDOUT:  You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

STDERR: Error: Package: php70-7.0.29-1.28.amzn1.x86_64 (amzn-main)
Requires: php70-cli(x86-64) = 7.0.29-1.28.amzn1
Available: php70-cli-7.0.29-1.28.amzn1.x86_64 (amzn-main)
php70-cli(x86-64) = 7.0.29-1.28.amzn1
Available: php70-cli-7.0.30-1.29.amzn1.x86_64 (amzn-updates)
php70-cli(x86-64) = 7.0.30-1.29.amzn1
Available: php70-cli-7.0.31-1.30.amzn1.x86_64 (amzn-updates)
php70-cli(x86-64) = 7.0.31-1.30.amzn1
Available: php70-cli-7.0.32-1.31.amzn1.x86_64 (amzn-updates)

等等。

这是我的食谱代码:

 when 'amazon'
     node.override['php']['packages'] = ['php70', 'php70-devel', 'php70-cli', 'php70-bcmath', 'php70-snmp', 'php70-soap', 'php70-xml', 'php70-xmlrpc', 'php70-process', 'php70-mysqlnd', 'php70-opcache', 'php70-pdo', 'php70-imap', 'php70-mbstring', 'php70-intl', 'php70-mcrypt', 'php70-gd']

但是,当我尝试仅运行配方设置时,它将安装所有这些应用程序,但我更希望我可以解决此问题,并且当我尝试创建新实例时,它将从第一时间开始工作

1 个答案:

答案 0 :(得分:0)

即使我尝试安装PHP 7.1,我也遇到相同的错误:

================================================================================
Error executing action `install` on resource 'yum_package[php71, php71-devel, php71-cli, php71-bcmath, php71-snmp, php71-soap, php71-xml, php71-xmlrpc, php71-process, php71-mysqlnd, php71-opcache, php71-pdo, php71-imap, php71-mbstring, php71-intl, php71-mcrypt, php71-gd]'
================================================================================

Chef::Exceptions::Exec
----------------------
yum -d0 -e0 -y install php71-7.1.15-1.31.amzn1 php71-devel-7.1.15-1.31.amzn1 php71-cli-7.1.15-1.31.amzn1 php71-bcmath-7.1.15-1.31.amzn1 php71-snmp-7.1.15-1.31.amzn1 php71-soap-7.1.15-1.31.amzn1 php71-xml-7.1.15-1.31.amzn1 php71-xmlrpc-7.1.15-1.31.amzn1 php71-process-7.1.15-1.31.amzn1 php71-mysqlnd-7.1.15-1.31.amzn1 php71-opcache-7.1.15-1.31.amzn1 php71-pdo-7.1.15-1.31.amzn1 php71-imap-7.1.15-1.31.amzn1 php71-mbstring-7.1.15-1.31.amzn1 php71-intl-7.1.15-1.31.amzn1 php71-mcrypt-7.1.15-1.31.amzn1 php71-gd-7.1.15-1.31.amzn1 returned 1:
STDOUT:  You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest