Lumen httpclient 请求自己 API 超时问题!?!

IndexController.php

    function test(Request $request)
    {
        //$uri = "http://www.baidu.com";
        $uri = "http://localhost:8083/test1";

        $curl = curl_init();
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_TIMEOUT, 60);
        curl_setopt($curl, CURLOPT_URL, $uri);
        $res = curl_exec($curl);
        //var_dump($res);
        curl_close($curl);

        echo $res;

    }
    function test1()
    {
        echo  '111111111111111111';
    }

routes/web.php

$router->get('test','Index\IndexController@test');
$router->get('test1','Index\IndexController@test1');

页面调用 http://localhost:8083/test 超时!!
不知是什么原因
把$uri改为 其他地址(例如:http://www.baidu.com )可以正常访问 ?
请问大神门这是什么原因造成的?

《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
讨论数量: 2

看看 selinux 的状态?

5年前 评论

@BruceP 我是在window下写代码的,用的是 nginx

5年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!