2017-01-02 101 views
-1

环境Apache不加载正确的文件

Host - Windows 10 
Browser - GoogleChrome (Caching is disabled) 
IDE - Intelij IDEA 

Oracle VirtualBox with CentOS 7 
Apache Server 
PHP Version 5.6.29 
PHP Composer 

问题

我有我的系统一个非常令人沮丧的行为。

如果我开始我的VirtualBox和Apache,网站correkt显示,但如果我在HTML改变的东西它没有加载到浏览器中,但在共享文件夹是正确的。

Screen from IDE IDEA

Code in the Shared folder

Loaded file from the browser

但是如果删除按钮时,它被示出正确(无按钮)。如果我再次添加该按钮,则在另一个位置上,该按钮将显示在带有旧标签的旧位置。

是否有人可以解释这种行为,或有有关此问题的一些诀窍? 我不知道哪个组件触发了这种行为。

------- UPDATE 1 ---------

login.html文件是在UTF8

有一件事我IST以前没有见过,这条线在浏览器中编辑器(开发者模式)。

enter image description here

----------- UPDATE 2 -----------

我添加此更新创造更好的说明问题。

这是原来的HTML

<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="UTF-8"> 
    <title>Title</title> 
</head> 
<body> 
<h1>Login</h1> 
<form method="POST" action="../controller/login.php"> 
    <input id="txtUsername" type="text" placeholder="username"/> 
    <input id="txtPassword" type="password" placeholder="password"/> 
    <input id="btnSubmit" type="submit"/> 
</form> 
</body> 
</html> 

Output of the original HTML Code

如果我将提交按钮的顶部,或者改变原有的密码,并点击CTRLF5,没有什么变化。只有在浏览器开发商编辑器出现红点(如果我悬停在一个点,我得到的提示\u0

<h1>Login</h1> 
<form method="POST" action="../controller/login.php"> 
    <input id="btnSubmit" type="submit"/> 
    <input id="txtUsername" type="text" placeholder="username"/> 
    <input id="txtPassword" type="password" placeholder="password"/> 
</form> 

enter image description here

下面的幻灯片,在源文件夹中的服务器上文件已更改正确。

enter image description here

+0

也许缓存问题?尝试刷新页面CTRL + F5 – Hokusai

+0

不,我试过了。如果我在'html'中改变了某些东西,我可以看到,有些东西改变了,但是错误的东西。如果我添加一个''我可以看到它们。如果我将它移动两行......我有3个“文本字段”,但没有“按钮”。现在我尝试使用'',这个工作,但是...为什么我不能使用按钮标签。在http://caniuse.com/#search=button我可以看到,按钮标签应该能够在我的浏览器中使用(Chrom 55.0.2883.87米)。 。 –

+0

听起来不像是一个PHP问题。什么是正确的行为,你能展示正确的显示和代码吗?您还应该将实际的代码添加到问题中。用户不想抄录.. – chris85

回答

0

嗯,这个问题的原因很简单。 Windows中的CRLF不是像CentOS的一样,有它是一个LF。

另一个需要一点时间的问题是,CRLF无法在我的IDE或我使用的其他工具中读取。

随着dos2unix我可以修复它。