doujiao7325 2012-08-21 13:38
浏览 321

错误324(net :: ERR_EMPTY_RESPONSE):服务器关闭连接而不发送任何数据

I get this error

Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

in my PHP functions if I do not do an echo followed by a flush(). In these functions where I have to do the echo and flush(), I am using shell_exec() to run phantomjs and processing the result returned by it using simple_html_dom. I am also using a PHP framework called Laravel.

What cause this error, and why does echoing and doing a flush() fix this error?

  • 写回答

1条回答 默认 最新

  • dsvjmc0907 2013-05-07 23:56
    关注

    Typically, Laravel expects output to be returned by your route or controller, not echoed. As an example, you might have

    Route::get('foo', function() {
        return 'Hi';
    });
    

    Laravel will then output 'Hi' to the browser. Depending on your needs, you can either build this output yourself or make use of Laravel's View or Response classes to format the data in a way that is appropriate for your app.

    If you absolutely need to flush output using echo, here's one possible way to do it through a view file.

    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?