1

I've got this :

try{
    $soap = new SoapClient("https://www.ovh.com/soapi/soapi-re-1.8.wsdl");
    $session = $soap->login("$nic", "$pass","fr", false);
    $result = $soap->telephonySmsSend($session, "$sms_compte", "$from", "$to", "$message", "", "1", "", "");
    $soap->logout($session);
}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 ?

Saroten
  • 295
  • 1
  • 5
  • 16
  • possible duplicate of [Fatal error: Class 'SoapClient' not found](http://stackoverflow.com/questions/11391442/fatal-error-class-soapclient-not-found) – mim. Jun 02 '15 at 10:51

2 Answers2

1

We have Nginx with Fedora 20 realise I have installed soap with following command.

yum install php-soap

Then I went to php.ini to un-comment soap extension. It was not there so, I added my own following line.

extension=soap.so Then i restart server with following command

service nginx restart

Good luck:)

Correcter
  • 3,466
  • 1
  • 16
  • 14
0

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 http://php.net/manual/en/soap.requirements.php

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://pear.php.net/SOAP-0.13.0

.Install HTTP_Request2 (optional)

install ok: channel://pear.php.net/HTTP_Request2

.Restart Services » HTTP Server (Apache)

From shell command

1.) pear install SOAP

2.) Reboot

Deep Kakkar
  • 5,831
  • 4
  • 39
  • 75