简体   繁体   English

如何在 Amazon Linux 2 CentOS7 上安装 PHP 5.56?

[英]How can I install PHP 5.56 on Amazon Linux 2 CentOS7?

When I run sudo yum install php56 on my centos7 ec2 instance, the actual version installed is 5.4.当我在我的 centos7 ec2 实例上运行sudo yum install php56时,实际安装的版本是 5.4。

Installing:
php                x86_64      5.4.16-46.amzn2.0.2       amzn2-core      1.4 M
php-cli            x86_64      5.4.16-46.amzn2.0.2       amzn2-core      2.8 M

I canceled that and tried an archive sudo yum install --enablerepo=ius-archive php56u and got an dependency error:我取消了它并尝试了一个存档sudo yum install --enablerepo=ius-archive php56u并得到了一个依赖错误:

--> Finished Dependency Resolution
Error: Package: php56u-common-5.6.40-1.ius.el7.x86_64 (ius-archive)
       Requires: php56u-pecl-jsonc(x86-64)
       Available: php56u-pecl-jsonc-1.3.6-2.ius.el7.x86_64 (ius-archive)
           php56u-pecl-jsonc(x86-64) = 1.3.6-2.ius.el7
       .....

How do I resolve that package?我如何解决那个包?

I have considered building php 5.6 from source using steps from this site but it is quite long and complicated and I am not an expert.我曾考虑使用本网站的步骤从源代码构建 php 5.6,但它非常长且复杂,而且我不是专家。 I would rather figure out how to fix the dependency error above.我宁愿弄清楚如何解决上面的依赖错误。

Any other ideas on how I can get php 5.5+ (I cannot do php7) on this Amazon Linux 2 machine?关于如何在这台 Amazon Linux 2 机器上获得 php 5.5+(我不能执行 php7)的任何其他想法?

I 'fixed' my issue, though not by installing php 5.6.我“修复”了我的问题,但不是通过安装 php 5.6。 In the end I realized I was spending alot of time trying to get old unsupported code when I could instead spend that time making my code work with php 7/Maria - something I would eventually have to do anyways.最后我意识到我花了很多时间试图获得旧的不受支持的代码,而我可以花时间让我的代码与 php 7/Maria 一起工作 - 无论如何我最终都必须这样做。 Yes, it's taken a few days to work out the kinks, but it's time well spent.是的,解决这些问题需要几天时间,但时间花得很好。 Adios PHP5. Adios PHP5。

I won't mark this as an answer since it doesn't directly address the challenge.我不会将此标记为答案,因为它没有直接解决挑战。

IUS is not compatible with Amazon Linux. IUS 与 Amazon Linux 不兼容。 Anything that happens to work is pure luck and should not be counted on.任何发生的事情都是纯粹的运气,不应该被指望。

https://ius.io/faq#is-ius-compatible-with-amazon-linux https://ius.io/faq#is-ius-compatible-with-amazon-linux

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

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