Php rest服务未返回正确的响应

Php rest服务未返回正确的响应,php,rest,Php,Rest,我最近想使用一个只在Php中可用的库() 由于我对Php真的不太了解,为了能够将它与我的其他Web服务(.Net core)一起使用,我决定最好的方法是将它作为自己的Rest服务托管 我尝试过使用,但没有效果,我得到的所有响应都是200(Ok),即使端点不正确。浏览器和本地控制台均无错误 我使用php-S localhost:8888 index.php启动它。我错过什么了吗 index.php <?php include 'vendor/autoload.php'; use Rest

我最近想使用一个只在Php中可用的库(

由于我对Php真的不太了解,为了能够将它与我的其他Web服务(.Net core)一起使用,我决定最好的方法是将它作为自己的Rest服务托管

我尝试过使用,但没有效果,我得到的所有响应都是200(Ok),即使端点不正确。浏览器和本地控制台均无错误

我使用
php-S localhost:8888 index.php
启动它。我错过什么了吗

index.php

<?php 
include 'vendor/autoload.php';

use RestService\Server;

require_once("restGameQ.php");
Server::create('/GameQ', 'GameQRestApi\GameQApi')
    ->collectRoutes()
->run();
<?php
namespace GameQRestApi;

class GameQApi {
    /**
    * Dummy response check.
    */
    public function getHi(){
        return 'Hi!';
    }

    /**
    * Gets state of server defined in server.json
    */
    public function getServersState(){
        $GameQ = new \GameQ\GameQ();
        $GameQ->addServersFromFiles('servers.json');
        return $GameQ->process();
    }

    /**
    * Checks state of the server under this address (accepted types consult: https://github.com/Austinb/GameQ/tree/v3/src/GameQ/Protocols )
    */
    public function postCheckServer($type, $ip, $port){
        $GameQ = new \GameQ\GameQ();
        $GameQ->addServer([
            'type' => $type,
            'host' => $ip+':'+$port,
        ]);
        return $GameQ->process();
    }
}

经过一些研究,我发现marcj/php rest服务是一个旧的repo,在新的php版本中有很多问题


是一个很好的、仍然受支持的、健壮的框架,可以满足您的HTTP需求。

经过一些研究,我发现marcj/php rest服务是一个旧的repo,在新的php版本中存在许多问题


是一个很好的、仍然受支持且健壮的框架,可以满足您的HTTP需求。

更新:peachpie确实支持
stream\u select
,因为
0.9.600
(2019年12月)是的,它解决了我自己报告的一个问题。但是没有时间去测试它。更新:peachpie确实支持
stream\u select
,因为
0.9.600
(2019年12月)是的,它解决了我自己报告的一个问题。但是没有时间去测试它。