php 如何解决在 apache 上找不到 favicon.ico 错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13154603/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 04:51:47  来源:igfitidea点击:

How to resolve favicon.ico not found error on apache

phpapache

提问by Asmita

I am getting following error while running index.php file on apache

在 apache 上运行 index.php 文件时出现以下错误

File does not exist: /home/../../../../favicon.ico

What does this mean? What should I change to resolve it?

这是什么意思?我应该改变什么来解决它?

回答by Matt

Favicon.ico is an icon file that is displayed next to the URL in the browser bar. (See the StackExchange icon next to the URL).

Favicon.ico 是一个图标文件,显示在浏览器栏中的 URL 旁边。(请参阅 URL 旁边的 StackExchange 图标)。

There is no way to stop browsers requesting it. You can either create a favicon, or create a zero byte file called favicon.ico and place in the web root.

没有办法阻止浏览器请求它。您可以创建一个 favicon,或创建一个名为 favicon.ico 的零字节文件并将其放置在 Web 根目录中。

回答by Danimal Reks

I found this helps if you are not working from the root directory. This eliminated the error for me. It is placed in the head.

我发现如果您不在根目录下工作,这会有所帮助。这消除了我的错误。它被放置在头部。

<link rel="icon" href="favicon.png" sizes="16x16" type="image/png">