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

我还从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

请帮我 。提前致谢

4

1 回答 1

0

找不到该类Client,因为您试图通过include. 无需克隆存储库,只需将其与 composer 集成即可。

composer require signalwire/signalwire

您可以在此处阅读有关设置PHP Relay SDK的更多文档,您可以在其中找到完整的工作示例。

于 2020-07-07T19:07:00.273 回答