消息:file_get_contents(sso.json):无法打开流:没有这样的文件或目录

sya*_*ein 4 php json

我正在尝试手动从 JSON 文件中获取数据,而不是从 URL 中获取数据。我使用函数file_get_contents。我得到了错误:

消息:file_get_contents(sso.json):无法打开流:没有这样的文件或目录

即使路径是正确的。这是我的结构项目:

-> kalenderkerja
   -> application
      -> controllers
         -> agendakerja
            Kalender.php
            sso.json
   -> assets
   -> ...
Run Code Online (Sandbox Code Playgroud)

这是我在文件Kalender.php中的函数user()中的代码

public function user() {
    $url = 'sso.json';
    $data = file_get_contents($url);
    $characters = json_decode($data, true);

    echo $characters['name'];
}
Run Code Online (Sandbox Code Playgroud)

我在浏览器localhost/kalenderkerja/agendakerja/kalender/user 中调用控制器 ,我收到了这个错误: 在此处输入图片说明