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 中调试它


基础教程推荐
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何替换eregi() 2022-01-01