1、先執(zhí)行以下文件存在代碼,沒有問題
<?php
namespace app\controller;
use support\Request;
class FooController
{
public function hello(Request $request)
{
return response()->file(public_path() . '/favicon.ico');
}
}
2、再修改為以下不存在的文件代碼,第一次執(zhí)行報錯,第二次執(zhí)行才是404
<?php
namespace app\controller;
use support\Request;
class FooController
{
public function hello(Request $request)
{
return response()->file(public_path() . '/favicon888.ico');
}
}
返回文件流,文件不存在,第一次報錯,第二次才404
ErrorException: filemtime(): stat failed for D:\www.wtbis.cn\webman\public/favicon8.ico in D:\www.wtbis.cn\webman\vendor\workerman\webman-framework\src\Http\Response.php:69
Stack trace: