如何在PHP 7.0 Ubuntu 18.10中启用SoapClient

时间:2019-03-19 06:19:04

标签: php ubuntu soap soap-client

我正在使用PHP 7.0 Ubuntu 18.10,并且无法在我的phpinfo()中启用模块SoapClient。

我已经删除了“;”在我的php.ini配置中,然后重新启动apache2以启用soap模块。

extension=php_soap.dll
extension=soap

当我检查phpinfo()时,这就是我得到的。

enter image description here

还检查了soap是否已安装我的服务器。

root@localhost:~# apt-cache search php | grep -i soap
libnusoap-php - SOAP toolkit for PHP
php-soap - SOAP module for PHP [default]
php7.2-soap - SOAP module for PHP
python-pysimplesoap - simple and lightweight SOAP Library (Python 2)
python3-pysimplesoap - simple and lightweight SOAP Library (Python 3)
root@localhost:~# 

即使是以上结果,我仍然试图安装php7.0-soap,这就是我得到的。

root@localhost:~# sudo apt-get install php7.0-soap 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php7.0-soap
E: Couldn't find any package by glob 'php7.0-soap'
E: Couldn't find any package by regex 'php7.0-soap'

请帮助我。谢谢!

2 个答案:

答案 0 :(得分:3)

这对我也有用PHP 7.0的Ubuntu 18

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2-soap

答案 1 :(得分:0)

我的问题通过在终端中运行下面的命令解决了:

  1. sudo add-apt-repository ppa:ondrej/php

  2. sudo apt-get update

  3. sudo apt-get install php7.2-soap