PHP: I get a completely blank page, I don#39;t know how to debug this in PHP(PHP:我得到一个完全空白的页面,我不知道如何在 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 中调试它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP:我得到一个完全空白的页面,我不知道如何在 PHP 中调试它
- 带有通配符的 Laravel 验证器 2021-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- Laravel 仓库 2022-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01