我有一个大问题,因为当我试图显示我的 ts3 服务器的状态时,我有空白页......我做错了什么?
require_once('libraries/TeamSpeak3/TeamSpeak3.php');
try
{
// connect to server, authenticate and grab info
$ts3 = TeamSpeak3::factory("serverquery://query_admin:query_pass@host:10011/?server_port=9987");
// show server as online
$serverinfo[$j]['hostname'] = $ts3->virtualserver_name;
$serverinfo[$j]['online'] = 'online';
$serverinfo[$j]['players'] = $ts3->virtualserver_clientsonline;
$serverinfo[$j]['max'] = $ts3->virtualserver_maxclients;
}
catch(Exception $e)
{
// grab errors and show server as offline
$serverinfo[$j]['online'] = 'offline';
$serverinfo[$j]['players'] = '-';
$serverinfo[$j]['max'] = '-';
}
当我评论此代码时,页面显示正常...
编辑:我现在看到了,如果我只添加这个 require_once('libraries/TeamSpeak3/TeamSpeak3.php'); 仅此而已,我的代码显示空白页...是否有可能,此处的该库无法正常工作?