Skip to main content
Published: May 03 2007, 4:59:00 PMUpdated: November 28 2020, 3:41:00 PM

Solution to this problem is to enable the php_soap extension in your php.ini file.

'SoapClient' not Found Error

When running the eBay supplied PHP 5 SOAP samples you may encounter the following error :

C:\temp\eBaySOAP>php GetUser.php

Fatal error: Class 'SoapClient' not found in C:\temp\eBaySOAP\eBaySOAP.php on line 80



Windows Solution

Solution to this problem is to uncomment the php_soap.dll extension in the php.ini file by removing the leading semi-colon :

extension=php_soap.dll


A web server restart will be required for the change to be recognized by the server.


Linux / Unix Solution

*nix platforms often have the PHP 5 SOAP extension compiled but not loaded. If so, update your php.ini by adding the following to the extension section :

extension=php_soap.so

If the extension is still not found, you can try to load it using yum on Red-Hat-like Linux systems :

# yum install php-soap
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
core                                                                 [1/3]
updates                                                              [2/3]
extras                                                               [3/3]
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for php-soap to pack into transaction set.
php-soap-5.1.6-1.6.i386.r 100% |=========================|  15 kB    00:00
---> Package php-soap.i386 0:5.1.6-1.6 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 php-soap                i386       5.1.6-1.6        updates           135 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 135 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): php-soap-5.1.6-1.6 100% |=========================| 135 kB    00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: php-soap                     ######################### [1/1]

Installed: php-soap.i386 0:5.1.6-1.6
Complete!
# apachectl graceful
#



If the extension is not recognized after a web server restart, you will probably need to rebuild. Repeat your previous build process, but add the --enable-soap option to the configure command.

How well did this answer your question?
Answers others found helpful