Class 'SoapClient' not found
Asked Answered
U

5

5

I am integrating a payment gateway using SOAP. When i am calling service function using Wamp its working well. But on my live server it is giving folloing error- Class 'SoapClient' not found

the code i am using is

<?php
try
{
$soap_client=new SoapClient("WebServiceLink/service.asmx?WSDL");

$quote=$soap_client->PGI_TRANS("PassedParameter");
    echo $quote->PGI_TRANSResult;
}
catch(SoapFault $exception)
{
    echo $exception->getmessage();
}
?>
Usn answered 23/5, 2013 at 17:58 Comment(1)
possible duplicate of Fatal error: Class 'SoapClient' not foundLadle
S
7

enable your soap extension in php. open php.ini find the line have "php_soap" and uncomment this line, restart web server, problem solved.

Schlemiel answered 6/9, 2013 at 13:37 Comment(0)
N
4

You shouldn't have to modify php.ini to enable soap on modern distributions. If it's not enabled, the package probably isn't installed. Once you install the correct package, your distro should enable the correct php.ini settings for you.

On Ubuntu:

sudo apt-get install php-soap

will install and enable the soap extensions for you.

Neat answered 12/3, 2017 at 21:52 Comment(0)
T
0

You have to inherit nusoap.php class and put it in your project directory, you can download it from the Internet.

Download Link: http://sourceforge.net/projects/nusoap/

Use this code:

require_once('nusoap.php');

Timbuktu answered 24/8, 2016 at 13:32 Comment(0)
K
0

For Ubuntu17.10 Artful I've used the following command to view exact package name (it can be different).

>> apt-cache search php | grep -i soap
libnusoap-php - SOAP toolkit for PHP
php7.1-soap - SOAP module for PHP
python-pysimplesoap - simple and lightweight SOAP Library (Python 2)
python3-pysimplesoap - simple and lightweight SOAP Library (Python 3)
php-soap - SOAP module for PHP [default]
php5.6-soap - SOAP module for PHP
php7.0-soap - SOAP module for PHP
php7.2-soap - SOAP module for PHP

That's how I get the name. Then just install it.

sudo apt-get install php5.6-soap

P.S. Don't forget to update repository sudo apt-get install php-soap

Kentiggerma answered 18/12, 2017 at 6:21 Comment(0)
T
0

For Ubuntu, running the following commands fixed my issue,

sudo apt-get install php-soap

then run

sudo service apache2 restart
Tensimeter answered 30/4, 2018 at 19:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.