BigBlueButton Api - 未捕获类型错误:stream_get_meta_data():参数 #1 ($stream) 必须是资源类型,给定 bool

问题描述 投票:0回答:1

我尝试通过 PHP Api 将我的网站与 BBB 服务器连接。

我用 https://mconf.github.io/api-mate/ 检查了秘密和网址,它有效。但是当我在服务器上运行代码时出现此错误。

我检查了服务器并且一切正常。

错误如下:

Fatal error: Uncaught TypeError: stream_get_meta_data(): Argument #1 ($stream) must be of type resource, bool given in ***\vendor\bigbluebutton\bigbluebutton-api-php\src\BigBlueButton.php:465 Stack trace: #0 ***\vendor\bigbluebutton\bigbluebutton-api-php\src\BigBlueButton.php(465): stream_get_meta_data(false) #1 ***\vendor\bigbluebutton\bigbluebutton-api-php\src\BigBlueButton.php(249): BigBlueButton\BigBlueButton->processXmlResponse('https://bbb.mv-...') #2 ***\cal\cal.php(821): BigBlueButton\BigBlueButton->getMeetings() #3 {main} thrown in ***\vendor\bigbluebutton\bigbluebutton-api-php\src\BigBlueButton.php on line 465

这是 cal.php 中的部分代码

putenv("BBB_SECRET=***");
putenv("BBB_SERVER_BASE_URL=https://bbb.***/bigbluebutton/");

$bbb = new BigBlueButton();
$response = $bbb->getMeetings();

if ($response->getReturnCode() == 'SUCCESS') {
   foreach ($response->getRawXml()->meetings->meeting as $meeting) {
  ...

我从 BBB Github 复制了代码,没有进行任何更改

我只是尝试以编程方式添加会议,但仍然是相同的错误。

有人可以帮助我吗?

php bigbluebutton
1个回答
0
投票

我已经发现问题了。 php_xml 未初始化。初始化 php_xml 后效果很好。

© www.soinside.com 2019 - 2024. All rights reserved.