首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
下面的pathinfo变量为什么始终为favicon.ico?
## **服务器端的代码:** <?php $http = new swoole_http_server("0.0.0.0", 9511); $http->set(array('worker_num'=>16,'daemonize'=>0)); $http->on('request', function ($request, $response) { print_r($request); print_r($response); $fileName = __DIR__.$request->server['path_info']; //这里的path_info始终为favicon.ico为什么 var_dump($fileName); $response->end("<h1>Hello Swoole. #".rand(1000, 9999)."</h1>"); }); $http->start(); **客户端请求地址为:http://10.1.1.165:9511/b.php** **服务器端显示的结果:** swoole_http_request Object ( [fd] => 1 [header] => Array ( [host] => 10.1.1.165:9511 [connection] => keep-alive [pragma] => no-cache [cache-control] => no-cache [user-agent] => Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 [accept] => */* [referer] => http://10.1.1.165:9511/b.php [accept-encoding] => gzip, deflate, sdch [accept-language] => zh-CN,zh;q=0.8 ) [server] => Array ( [request_method] => GET [request_uri] => /favicon.ico [path_info] => /favicon.ico [request_time] => 1471001723 [request_time_float] => 1471001723.9895 [server_port] => 9511 [remote_port] => 55597 [remote_addr] => 10.1.1.163 [server_protocol] => HTTP/1.1 [server_software] => swoole-http-server ) ) swoole_http_response Object ( [fd] => 1 ) string(39) "/home/wanjn/phpproject/chat/favicon.ico" 上面的pathinfo变量为什么始终为favicon.ico,不懂,求大神帮助,谢谢了、、、、、、、 - 。 -
发布于8年前 · 0 次浏览 · 来自
提问
穿
穿靴子的猫
## **服务器端的代码:** <?php $http = new swoole_http_server("0.0.0.0", 9511); $http->set(array('worker_num'=>16,'daemonize'=>0)); $http->on('request', function ($request, $response) { print_r($request); print_r($response); $fileName = __DIR__.$request->server['path_info']; //这里的path_info始终为favicon.ico为什么 var_dump($fileName); $response->end("<h1>Hello Swoole. #".rand(1000, 9999)."</h1>"); }); $http->start(); **客户端请求地址为:http://10.1.1.165:9511/b.php** **服务器端显示的结果:** swoole_http_request Object ( [fd] => 1 [header] => Array ( [host] => 10.1.1.165:9511 [connection] => keep-alive [pragma] => no-cache [cache-control] => no-cache [user-agent] => Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 [accept] => */* [referer] => http://10.1.1.165:9511/b.php [accept-encoding] => gzip, deflate, sdch [accept-language] => zh-CN,zh;q=0.8 ) [server] => Array ( [request_method] => GET [request_uri] => /favicon.ico [path_info] => /favicon.ico [request_time] => 1471001723 [request_time_float] => 1471001723.9895 [server_port] => 9511 [remote_port] => 55597 [remote_addr] => 10.1.1.163 [server_protocol] => HTTP/1.1 [server_software] => swoole-http-server ) ) swoole_http_response Object ( [fd] => 1 ) string(39) "/home/wanjn/phpproject/chat/favicon.ico" 上面的pathinfo变量为什么始终为favicon.ico,不懂,求大神帮助,谢谢了、、、、、、、 - 。 -
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2019-06-27
广
广州万希互动传媒
我正在看@半桶水老师的视频,视频上是说这个是网站ico文件, [attach]225[/attach] 就是这样咯
赞
0
回复