亲爱的StackOverflow社区,
我对Composer很陌生,所以解决方案可能很容易,但我不明白。
我的PHP文件是这样的
<html>
<head>
<title>ServerStatusChecker</title>
<link rel="icon" href="favicon.ico">
</head>
<body>
<?php
echo "1";
require '/vendor/autoload.php';
echo "2";
use MinecraftServerStatusMinecraftServerStatus;
echo "3";
$response = MinecraftServerStatus::query('mineplex.com', 25565);
echo "4";
if (! $response) {
echo "The Server is offline!";
} else {
echo "<img width="64" height="64" src="" . $response['favicon'] . "" /> <br>
The Server " . $response['hostname'] . " is running on " . $response['version'] . " and is online,
currently are " . $response['players'] . " players online
of a maximum of " . $response['max_players'] . ". The motd of the server is '" . $response['description'] . "'.
The server has a ping of " . $response['ping'] . " milliseconds.";
}
?>
</body>
</html>
所以我的问题是,当我调用网页时,它保持空白,除了一个调试1
。
我没有得到可见的错误消息或类似的。那么为什么会发生这种情况和/或我做错了什么?
亲切的问候
将第10行require '/vendor/autoload.php';
改为require './vendor/autoload.php';
,成功了