Slim framework - cannot interpret routes with dot

后端 未结 4 910
离开以前
离开以前 2020-12-19 13:46

Problem Statement

I\'m currently working on an internal RESTful API, and I\'m using our main domain name as an environment identifier. However, I noticed that Slim

4条回答
  •  温柔的废话
    2020-12-19 14:04

    I've just added this to the top of router script (index.php in my case):

    if (PHP_SAPI === 'cli-server') {
      $_SERVER['SCRIPT_NAME'] = pathinfo(__FILE__, PATHINFO_BASENAME);
    }
    

    Usage example:

    $ php -S localhost:8080 -t public index.php
    

提交回复
热议问题