PHP:我得到一个完全空白的页面,我不知道如何在 PHP 中调试它 [英] PHP: I get a completely blank page, I don't know how to debug this in PHP

查看:33
本文介绍了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 中调试它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆