简体   繁体   English

在虚拟机上查看“ localhost”时,PHP包含正在中断

[英]PHP Includes are chopping when viewing “localhost” on Virtual Machine

Here is my setup: I am coding on a Mac with VMware Fusion loaded (running Windows 8 on the VM). 这是我的设置:我在装有VMware Fusion的Mac上进行编码(在VM上运行Windows 8)。 The VM has IIS running on it so that I can do local testing of my code (written in Edge Code/Brackets). VM上运行着IIS,因此我可以对我的代码进行本地测试(用Edge Code / Brackets编写)。 I test the code by pointing my Mac browser at [ip address]:[port]/[file]. 我通过将Mac浏览器指向[ip地址]:[端口] / [文件]来测试代码。 This works fine usually, but I am running into a problem with my includes. 通常,这可以正常工作,但是我的包含文件遇到了问题。

Here is the structure: [index.php] 结构如下:[index.php]

<body>
<?php require '/Library/Includes/header.inc.php'; ?>

hello

[header.inc.php] [header.inc.php]

<div class="container_16">
<div class="grid_6">
    <img src="http://placehold.it/298x48" alt="Logo" />
</div>
<div class="grid_10">
    <?php include 'eyebrow.inc.php'; ?>
</div>

[eyebrow.inc.php] [eyebrow.inc.php]

<ul id="eyebrow-links" class="h-list">
     <li><img src="http://placehold.it/24x24" alt="User Avatar" /></li>
     <li><a href="#">My Profile</a></li>
     <li><a href="#">English</a></li>
     <li><a href="#">Logout</a></li>
</ul>

This is the output when I view the source from my Mac 当我从Mac查看源代码时,这是输出

<body>
    <div class="container_16">
    <div class="grid_6">
        <img src="http://placehold.it/298x48" alt="Logo" />
    </div>
    <div class="grid_10">
        <ul id    </div>
</div>    
hello

It's chopping out a bit of my include. 它削减了我的包括。 When I test this same code on my Windows Machine, it behaves normally and returns the entire include. 当我在Windows计算机上测试相同的代码时,它会正常运行并返回整个包含。 Has anyone else run into this problem? 还有其他人遇到这个问题吗? Any idea what is happening? 知道发生了什么吗? I appreciate your help! 我感谢您的帮助!

Jason 杰森

The issue seems to be stemming from my first li element. 这个问题似乎源于我的第一个li元素。 It might be the reference to placehold.it that is breaking the include. 可能是对placehold.it的引用打破了包含。 Not sure why it only seems to have problems on my Mac and not my PC, but at least I'm narrowing down the issue. 不知道为什么它似乎只在我的Mac而不是我的PC上有问题,但是至少我正在缩小问题的范围。

UPDATE 更新

Nevermind. 没关系。 It just continues to break if I have 4 li elements. 如果我有4 li元素,它只会继续破裂。 Abandoning the issue and just ignoring it. 放弃问题,而忽略它。 Sorry! 抱歉!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM