【问题标题】:how do I troubleshoot blank browser in PHP [duplicate]如何在 PHP 中对空白浏览器进行故障排除 [重复]
【发布时间】:2017-09-30 06:12:28
【问题描述】:

我决定将我的全局页眉和页脚模板化,这就是问题开始的时候。浏览器是空白的,我不知道如何解决这个问题。我在 Mac 上使用 MAMP。这是我的文件结构:

这是我的 index.php:

    <?php

        include('../assets/includes/header.php');

        include('../assets/includes/footer.php');
    ?>

我觉得这与我在 include() 中引用它的方式有关,但如果看到要阅读的错误会很高兴。

Here is my footer.php:

<div id="footer" class="cf">
                        <div class="column three">
                            <strong>Phone</strong>
                            609.505.3395
                        </div><!-- column -->
                        <div class="column three">
                            <strong>Location</strong>
                            <!-- location to go here -->
                        </div><!-- column -->
                        <div class="column three last">
                            <strong>Hours</strong>
                            <em>Tuesday - Thursday</em><br>
                            1:00pm - 9:00pm<br><br>
                            <em>Friday and Saturday</em><br>
                            4:00pm - 11:00pm<br><br>
                            <em>Sunday - Monday</em>
                            Closed<br><br>
                        </div><!-- column -->
                    </div><!-- footer -->
                    <small>&copy;2017 MicroUrb</small>
                </div><!-- content -->


    </div><!-- wrapper -->
    <div class="copyright-info">
        <?php include('../assets/includes/copyright.php'); ?>
    </div><!-- copyright-info -->

</body>
</html>

这是我的 header.php:

<!DOCTYPE html>
<html>
<head>
    <title>MicroUrb</title>
    <link rel="stylesheet" href="assets/styles.css">
</head>
<body id="final-example">
    <div class="wrapper">
        <div id="banner">
            <a href="/" title="Return to Home">
                <img src="assets/img/banner0.jpg" alt="MicroUrb">
                <div id="banner__text-content">
                    <h1 id="banner__title">MicroUrb</h1>
                </div>

            </a>
        </div><!-- banner -->

            <div id="nav">
                <?php include('includes/nav.php'); ?>
            </div><!-- nav -->

                <div class="content">

【问题讨论】:

    标签: php global


    【解决方案1】:

    将以下代码粘贴到 php 文件的顶部。这将显示所有错误。但请务必在production 时发表评论

    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);
    

    【讨论】:

    • 哦,不错的阿甘邦加
    猜你喜欢
    • 2020-10-02
    • 1970-01-01
    • 2016-04-28
    • 2015-07-07
    • 2021-11-22
    • 2013-05-31
    • 2017-02-15
    • 2011-02-07
    • 1970-01-01
    相关资源
    最近更新 更多