簡體   English   中英

在 Amazon EC2 上安裝 php-dom 擴展

[英]Install php-dom extension on Amazon EC2

我正在嘗試在新創建的 Amazon EC2 實例上安裝 php-dom 擴展失敗,但無論我怎么嘗試都失敗了...

我嘗試了以下命令(以及其他命令):

sudo yum install php-dom

sudo yum install php-xml

這是我每次得到的:

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                               | 3.7 kB     00:00     
202 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package php-xml.x86_64 0:5.4.16-46.amzn2.0.2 will be installed
--> Processing Dependency: php-common(x86-64) = 5.4.16-46.amzn2.0.2 for package: php-xml-5.4.16-46.amzn2.0.2.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.24)(64bit) for package: php-xml-5.4.16-46.amzn2.0.2.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: php-xml-5.4.16-46.amzn2.0.2.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: php-xml-5.4.16-46.amzn2.0.2.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.13)(64bit) for package: php-xml-5.4.16-46.amzn2.0.2.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: php-xml-5.4.16-46.amzn2.0.2.x86_64
--> Processing Dependency: libxslt.so.1()(64bit) for package: php-xml-5.4.16-46.amzn2.0.2.x86_64
--> Processing Dependency: libexslt.so.0()(64bit) for package: php-xml-5.4.16-46.amzn2.0.2.x86_64
--> Running transaction check
---> Package libxslt.x86_64 0:1.1.28-5.amzn2.0.2 will be installed
---> Package php-xml.x86_64 0:5.4.16-46.amzn2.0.2 will be installed
--> Processing Dependency: php-common(x86-64) = 5.4.16-46.amzn2.0.2 for package: php-xml-5.4.16-46.amzn2.0.2.x86_64
--> Finished Dependency Resolution
Error: Package: php-xml-5.4.16-46.amzn2.0.2.x86_64 (amzn2-core)
           Requires: php-common(x86-64) = 5.4.16-46.amzn2.0.2
           Installed: php-common-7.3.19-1.amzn2.x86_64 (@amzn2extra-php7.3)
               php-common(x86-64) = 7.3.19-1.amzn2
           Available: php-common-5.4.16-43.amzn2.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-43.amzn2
           Available: php-common-5.4.16-43.amzn2.0.1.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-43.amzn2.0.1
           Available: php-common-5.4.16-43.amzn2.0.2.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-43.amzn2.0.2
           Available: php-common-5.4.16-43.amzn2.0.3.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-43.amzn2.0.3
           Available: php-common-5.4.16-43.amzn2.0.4.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-43.amzn2.0.4
           Available: php-common-5.4.16-45.amzn2.0.5.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-45.amzn2.0.5
           Available: php-common-5.4.16-45.amzn2.0.6.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-45.amzn2.0.6
           Available: php-common-5.4.16-46.amzn2.0.2.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-46.amzn2.0.2
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

據我了解,php-xml(包括 php-dom)需要 php-common 版本 5.4.16(?!),但我運行的是 PHP 7.3 版,這可能是沖突的原因?

我對 AWS 還很陌生,甚至更多地了解終端命令,因此非常感謝這里的任何幫助! 如果您需要有關服務器的更多信息,我很樂意為您提供,我只是不知道那時有什么用...

謝謝你。

如果您使用安裝了 php 7.3

sudo amazon-linux-extras install php7.3

那么使用sudo yum install php-xml為 7.3 安裝php-xml應該沒有任何問題:

=======================================================================================================================================================================================
 Package                                Arch                                  Version                                           Repository                                        Size
=======================================================================================================================================================================================
Installing:
 php-xml                                x86_64                                7.3.19-1.amzn2                                    amzn2extra-php7.3                  

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM