-1
<?php
    //use SignalWire\Rest;
    
     include "/var/www/fusionpbx/app/messages/SignalWire/src/Rest/Client.php";
      $client = new Client('fc117c36-f3a3-45b1-8abf-cac52fa3355g', 'PT646f3c5a75ae162e3a403fba47455c7c07d27567992c9c51',array("signalwireSpaceUrl" => "logic.signalwire.com"));
       $message = $client->messages
                    ->create("+1(224)6785199",
                             array("from" => "+1(989)2780838", "body" => "Hello World!")
                    );

       print($message->sid);
    
?>

I also installed composer and cloned repository from https://github.com/signalwire/signalwire-php

myerror was Fatal error: Uncaught Error: Class 'Client' not found in /var/www/fusionpbx/app/messages/message_sms.php:33 Stack trace: #0 {main} thrown in /var/www/fusionpbx/app/messages/message_sms.php on line 33

please help me . Thanks in advance

Ed Lucas
  • 5,955
  • 4
  • 30
  • 42

1 Answers1

0

The Client class is not being found because you're attempting to load the SDK via an include. Instead of cloning the repository, simply integrate it with composer.

composer require signalwire/signalwire

You can read more documentation about setting up the PHP Relay SDK here, where you'll find full working examples.

John
  • 66
  • 7