Fatal error: Class Soap Client not found

Today i was creating web service through SOAP Client in PHP, but unfortunately i am getting fatal error ‘Class ‘SoapClient’ not found’ on applications. I spent some time on Google to find solution and found that, So here i am sharing my understanding regarding this error. This error can be occurred on Linux as well as Windows system.

Checkout other PHP SOAP Tutorials,

There are following reason to occurred error:

Linux

– You do not have php-soap installed.

Windows

– You have not un-commented the following line out from the php.ini file

By default it looks like this:
;extension=php_soap.dll

It should be look like this:
extension=php_soap.dll

Even if you are getting same error on windows system that means your extension directory path is not set. Sometimes on windows, your extension_dir path sets relative path.
I have found that simply un-commenting the extension_dir line will not do the trick. rather, you may have to set an absolute path to the extensions directory.

Example:
by default it looks like this:
;extension_dir="ext"

It should be look like this:
extension_dir="C:/php/ext"