laravel 致命错误:将 PHP 从 7.0 版升级到 7.2 版后找不到“SoapClient”类

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/48863486/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 17:25:08  来源:igfitidea点击:

Fatal error: Class 'SoapClient' not found after upgrading PHP from version 7.0 to 7.2

laravelapachelaravel-5soap-client

提问by hadi

I upgraded PHP 7.0to 7.2in Ubuntu. After performing an upgrade, I installed Laravel 5.6.

我在 Ubuntu 中将PHP 7.0升级到7.2。执行升级后,我安装了 Laravel 5.6。

Before the upgrade, class 'SoapClient' is true, but after the upgrade, I encountered

升级前,class 'SoapClient' 为真,但升级后,我遇到了

Fatal error: Class 'SoapClient' not found

致命错误:找不到“SoapClient”类

I checked php.iniin /etc/php/7.2/apache2/php.inibut I didn't see extension=php_soap.dllin php.ini.

我检查php.ini/etc/php/7.2/apache2/php.ini,但我没有看到extension=php_soap.dllphp.ini

How to resolve this issue?

如何解决这个问题?

回答by mySun

To install SOAP in PHP 7.2 run following in your Ubuntu 16.04 terminal:

要在 PHP 7.2 中安装 SOAP,请在 Ubuntu 16.04 终端中运行以下命令:

  1. sudo apt-get install php7.2-soap
  2. sudo service apache2 restart
  1. 须藤 apt-get 安装 php7.2-soap
  2. 须藤服务 apache2 重启

回答by Hiren Gohel

Look up the following inside your script file

在脚本文件中查找以下内容

phpinfo();

phpinfo();

Do the following:

请执行下列操作:

1.Locate php.iniin your apachebin folder, I.e Apache/bin/php.ini. Remove the ;from the beginning of extension=php_soap.dll

1.php.ini在你的apachebin文件夹中找到,即Apache/bin/php.ini;从开头删除extension=php_soap.dll

2.Restart your Apache server

2.重启你的Apache服务器

EDIT:

编辑:

For your problem you only need to install soap.

对于您的问题,您只需要安装soap

Run sudo apt-get install php7.2-soapto install soap and also run sudo service php7.2-fpm restartand sudo service apache2 restartand your problem fixed!

运行sudo apt-get install php7.2-soap安装肥皂和也跑sudo service php7.2-fpm restartsudo service apache2 restart和你的问题解决!

回答by Nileshsinh Rathod

First, check by phpinfo();This will show you Soap Clientis it enable or not

首先,检查phpinfo();这将显示您Soap Client是否启用

If it is disabled Do the following:

如果它被禁用,请执行以下操作:

  1. Locate php.ini in your apache bin folder, I.e Apache/bin/php.ini
  2. Remove the ; from the beginning of extension=php_soap.dll
  3. Restart your Apache server
  4. Look up your phpinfo(); again and check
  1. 在 apache bin 文件夹中找到 php.ini,即 Apache/bin/php.ini
  2. 去除那个 ; 从扩展开始=php_soap.dll
  3. 重启你的 Apache 服务器
  4. 查找你的 phpinfo(); 再次检查

If extension=php_soap.dllnot found in your php.inifollow below steps

如果extension=php_soap.dll在您php.ini按照以下步骤未找到

  1. sudo apt-get install php7.2-soap
  2. sudo service apache2 restart
  1. 须藤 apt-get 安装 php7.2-soap
  2. 须藤服务 apache2 重启