Centos

如何安裝 zend 框架 zend-soap

  • May 10, 2020

我正在嘗試使用 composer 安裝一個包。它失敗並顯示以下錯誤消息。

 Problem 1
   - zendframework/zend-soap 2.7.0 requires ext-soap * -> the requested PHP extension soap is missing from your system.
   - zendframework/zend-soap 2.7.0 requires ext-soap * -> the requested PHP extension soap is missing from your system.
   - zendframework/zend-soap 2.7.0 requires ext-soap * -> the requested PHP extension soap is missing from your system.
   - Installation request for zendframework/zend-soap 2.7.0 -> satisfiable by zendframework/zend-soap[2.7.0].

sudo yum 安裝 php-zendframework-zend-soap

這是我正在執行以安裝 zend-soap 的命令。但是,這會結束下面的錯誤消息。

--> Running transaction check
---> Package php-container-interop.noarch 0:1.2.0-3.el7 will be installed
---> Package php-psr-http-message.noarch 0:1.0.1-1.el7.remi will be installed
---> Package php-soap.x86_64 0:5.6.40-14.el7.remi will be installed
--> Processing Dependency: php-common(x86-64) = 5.6.40-14.el7.remi for package: php-soap-5.6.40-14.el7.remi.x86_64
---> Package php-zendframework-zend-eventmanager.noarch 0:2.6.3-1.el7.remi will be installed
--> Finished Dependency Resolution
Error: Package: php-soap-5.6.40-14.el7.remi.x86_64 (remi-php56)
          Requires: php-common(x86-64) = 5.6.40-14.el7.remi
          Installed: php-common-7.2.20-1.el7.remi.x86_64 (@remi-php72)
              php-common(x86-64) = 7.2.20-1.el7.remi
          Available: php-common-5.4.16-48.el7.x86_64 (base)
              php-common(x86-64) = 5.4.16-48.el7
          Available: php-common-5.4.45-18.el7.remi.x86_64 (remi)
              php-common(x86-64) = 5.4.45-18.el7.remi
          Available: php-common-5.6.40-13.el7.remi.x86_64 (remi-php56)
              php-common(x86-64) = 5.6.40-13.el7.remi
          Available: php-common-5.6.40-14.el7.remi.x86_64 (remi-php56)
              php-common(x86-64) = 5.6.40-14.el7.remi
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

我試過用 –skip-broken 執行它。這不會安裝缺少的 zend-soap。它被跳過。我執行了第二個建議,但什麼也沒發生。有誰知道如何在 CentOS 7 上安裝它。

      Installed: php-common-7.2.20-1.el7.remi.x86_64 (@remi-php72)

由於您已從“remi-php72”儲存庫安裝 PHP 7.2,因此您必須啟用此儲存庫以確保可以找到附加擴展。

這也將確保您從錯誤修復和安全更新中受益(最新版本是 7.2.30)

正如嚮導所解釋的那樣。

yum-config-manager --enable remi-php72

您還可以禁用不需要的儲存庫

yum-config-manager --disable remi-php56

進而

yum install php-soap

您需要安裝 PHP 的 soap 擴展。在 CentOS 7 上應該像這樣工作:

yum install php-soap

安裝完成後,您應該在 .in 中找到呼叫soap.ini的文件/etc/php.d和模組本身/usr/lib64/php/modules

接下來重新啟動您的 Apache 伺服器(或您正在使用的任何網路伺服器)

systemctl restart httpd

最後,您可以嘗試通過 Composer 安裝您的軟體包。這次應該下載並安裝軟體包。

引用自:https://serverfault.com/questions/1016374