English 中文(简体)
更新服务器,空白页
原标题:Updating server, blank pages

我最近参加了一个初级网络开发职位的工作面试考试。

其中一个问题是:在更新服务器后,您的网站没有显示任何页面,只是显示空白屏幕,没有错误。

Suggest what could cause this? What would be the process to find the cause of the problem? And how would you fix it?

I wasn t sure how to answer this question and was quite stuck on it. Could anyone describe an answer for me on this or can anyone point me to a website that describes how to deal with this problem?

最佳回答

这是一个非常模糊的问题——我非常怀疑它的设计只是为了 看看你如何思考和测试你的知识。

纯粹空白页面的唯一合理原因就是仅仅没有从所请求的位置读取任何文件内容。

这反过来又可能是由于仅仅有一个空白文件(0字节),或者由于将请求重定向到另一个空白(目前尚不存在任何错误)位置的不匹配配置。 例如,在阿帕奇语中,错误写入的.htaccess 可以做到这一点。

如果它是一个服务器端的脚本,比如 PHP, 服务器要么没有正确解析它, 要么没有打印到页面上, 则可能是一个替代方案。 这意味着没有数据可以写给客户端。 如果错误被关闭( 以免让客户感到困惑 ), 那么它们也不会显示, 留下空白页 。

问题回答

答案取决于您网站主页使用的技术。

这样的第一步是检查服务器日志出错。 例如, 如果您在生产时使用 PHP, 您应该设置 < code> display_ errors 来设置 < code> off , 这样您就会在出错时获得空白页面 。 例如: 您会检查日志, 并看到您的更新中断了您的 db 连接, 然后从那里继续 。

我敢肯定,他们正在寻找一个答案 提供逻辑的进化 和一些解决问题的能力。希望你做得好!





相关问题
Possible to sandbox Python configuration file?

I m thinking of implementing a configuration file written in Python syntax, not unlike what Django does. While I ve seen one or two SO questions about the merits of using executable code in ...

How to validate Java logging properties files?

I have a basic facility for allowing users to remotely apply changes to the logging files in my application. Some logs are configured using java.util.logging properties files, and some are configured ...

Where should I put this configuration setting?

I m designing a fairly small web application which will run on a Sun application server (v9.1). It only has a few pages, no database of its own, and will retrieve/update data via web services. There s ...

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

Dependency bundle (jar-files/sources/API docs) in Eclipse

I m developing various in-house extensions for JIRA, the issue tracker we use. So far I worked with Netbeans and everything worked like a charm. However, now I need to switch to Eclipse and I m ...

热门标签