Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class 'SoapClient' not found

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();
}
?>
like image 237
mayank Avatar asked May 23 '13 17:05

mayank


2 Answers

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

like image 111
Harrison Wang Avatar answered Sep 30 '22 07:09

Harrison Wang


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.

like image 45
Nick Avatar answered Sep 30 '22 08:09

Nick