Saroten Saroten - 1 year ago 99
PHP Question

soap class not found in local

I've got this :

$soap = new SoapClient("");
$session = $soap->login("$nic", "$pass","fr", false);
$result = $soap->telephonySmsSend($session, "$sms_compte", "$from", "$to", "$message", "", "1", "", "");
}catch(SoapFault $fault){
echo $fault;

The problem is that i've got an error telling me that the class SoapClient is not found.
How to create it ?

Answer Source

Write the following inside your PHP script file

<?php phpinfo(); ?>

If you can't find Soap Client set to enabled like so:

enter image description here

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();

Don't forget to also uncomment this line: ;extension=php_openssl.dll if the WSDL you are trying to reach is under https protocol again and check if you see a similar picture to the one above

If you do, problem solved!

In case if you does not find SOAP section in phpinfo()

For information the SOAP extension requires the libxml PHP extension. This means that passing in --enable-libxml is also required according to

From WHM panel

.Software » Module Installers » PHP Extensions & Applications Package

.Install SOAP 0.13.0

WARNING: "pear/HTTP_Request" is deprecated in favor of "pear/HTTP_Request2"

install ok: channel://

.Install HTTP_Request2 (optional)

install ok: channel://

.Restart Services » HTTP Server (Apache)

From shell command

1.) pear install SOAP

2.) Reboot

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download