PHP:我得到一个完全空白的页面,我不知道如何在PHP中调试它 [英] PHP: I get a completely blank page, I don't know how to debug this in PHP
问题描述
我在php中调试这个问题。当我包含这一行时:
I'm having some issues to debug this in php. When I include this line:
require_once("http://" . $_SERVER["HTTP_HOST"] . "/dompdf/dompdf_config.inc.php");
我得到的只是一个空白页面,我没有得到任何HTML代码作为回复。也许隐藏错误消息?
what I get is just a blank page, I don't get any html code as response. Maybe the error messages are hidden ?
推荐答案
您不应该要求/包含这样的远程文件。而是提供本地绝对路径或相对路径。
You should not require/include a remote file like this. Instead provide the local absolute or relative path.
虽然不安全且不推荐,但如果设置了某些配置选项,则技术上可行。 (allow_url_include)
Though insecure and not recommended, it is technically possible to do if certain configuration options are set. (allow_url_include)
请参阅下面有关display_errors的其他答案以了解将来的调试问题。我经常使用PHP命令行解释器来获取真正的错误,而不允许向Web访问者显示错误详细信息。
See other answers below regarding display_errors for future debugging concerns. I often use the PHP command line interpreter to get the real error, without allowing error details to be presented to web visitors.
这篇关于PHP:我得到一个完全空白的页面,我不知道如何在PHP中调试它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!