繁体   English   中英

在Amazon EC2实例上安装php和apache

[英]installing php and apache on Amazon EC2 instances

我试图在亚马逊ec2实例上安装PHP但是当我运行以下命令时:sudo yum -y install httpd php54-fpm php54-common

它给了我以下错误:

     Loaded plugins: priorities, security, update-motd, upgrade-helper
    Setting up Install Process
    Resolving Dependencies
   --> Running transaction check
   ---> Package httpd.x86_64 0:2.2.25-1.0.amzn1 will be installed
   --> Processing Dependency: httpd-tools = 2.2.25-1.0.amzn1 for package: httpd-2.2.25-     1.0.amzn1.x86_64
   --> Processing Dependency: apr-util-ldap for package: httpd-2.2.25-1.0.amzn1.x86_64
   ---> Package php54-common.x86_64 0:5.4.17-2.41.amzn1 will be installed
   ---> Package php54-fpm.x86_64 0:5.4.17-2.41.amzn1 will be installed
    --> Running transaction check
  enter code here ---> Package apr-util-ldap.x86_64 0:1.4.1-4.14.amzn1 will be installed
   ---> Package httpd-tools.x86_64 0:2.2.25-1.0.amzn1 will be installed
--> Processing Conflict: httpd24-tools-2.4.6-2.47.amzn1.x86_64 conflicts httpd-tools < 2.4.6
--> Processing Conflict: php54-common-5.4.17-2.41.amzn1.x86_64 conflicts php-common < 5.4.17-2.41.amzn1
--> Finished Dependency Resolution
Error: httpd24-tools conflicts with httpd-tools-2.2.25-1.0.amzn1.x86_64
Error: php54-common conflicts with php-common-5.3.27-1.0.amzn1.x86_64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

提前致谢。

你读过错误信息了吗? 再读一遍:

Error: httpd24-tools conflicts with httpd-tools-2.2.25-1.0.amzn1.x86_64
Error: php54-common conflicts with php-common-5.3.27-1.0.amzn1.x86_64

您正在尝试安装HTTPD 2.4,当您看起来安装了HTTPD 2.2并且与php相同时,即您安装了PHP 5.3并且您尝试安装5.4。 确认这一点的一种简单方法是在bash中键入以下内容:

php -v
httpd -V

如果要安装较新版本,请删除旧版本。

yum remove httpd-tools-2.2.25-1.0.amzn1.x86_64 php-common-5.3.27-1.0.amzn1.x86_64

更具体地说, httpd == 2.2版。 php54正在尝试安装httpd24

不要指定httpd 让您的PHP版本确定要安装的Apache版本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM