简体   繁体   English

我的PHP文件/浏览器刚冻结

[英]My PHP file/browser just frozed

Okay i'm just starting out on PHP & i'm doing the tutorials on the PHP manuals. 好的,我只是从PHP开始,我正在做PHP手册上的教程。 After doing the first part.. which is echo hello world!, my browser just frozed? 在完成第一部分..这是回声你好世界!,我的浏览器只是呆呆的? I refresh and all it says is Hello World! 我刷新了,它说的就是“ Hello World”! Even if I echo another word. 即使我呼应另一个单词。 Why doesn't it change? 为什么没有变化?

and i'm also using Wamp for my PHP. 而且我还在PHP中使用Wamp。

Did you save the file you are displaying after each edit? 您是否保存了每次编辑后显示的文件? If you have a file that contains <?php echo "Hello world"; ?> 如果您的文件包含<?php echo "Hello world"; ?> <?php echo "Hello world"; ?> and you show it in your browser, you should see "Hello world (without the quotes). If you change hello world to "Goodbye World", you will need to save the file. If you do not save it, you will keep on getting "Hello world" <?php echo "Hello world"; ?>并在浏览器中显示它,您应该看到“ Hello world(不带引号)。如果将hello world更改为“ Goodbye World”,则需要保存文件。如果不保存,则将继续获得“ Hello world”

If you are using WAMP then, please check that you have made proper settings in those. 如果您正在使用WAMP,请检查其中是否进行了正确的设置。 Like, 喜欢,

  1. Have you marked short tags open in the wamp configuration? 您是否在Wamp配置中将短标签标记为打开?
  2. Also check have you enabled the warnings & errors in PHP.ini file so that it will get the displayed in the browser & you will come to know the exact problem that you are facing. 还要检查是否在PHP.ini文件中启用了警告和错误,以便它会在浏览器中显示,并且您将确切地知道所面临的问题。
  3. As per the code given there seems to be no Syntax problem in it. 根据给定的代码,其中似乎没有语法问题。
  4. Also if you are creating files from some editors like Dreamweaver, etc. then please remove all the code including doc-type also from the file generated by that s/w. 另外,如果您是通过Dreamweaver等编辑器创建文件的,请同时从该软件生成的文件中删除所有代码,包括doc-type。 & write your code. 并编写您的代码。

For any help please let us know through comments. 对于任何帮助,请通过评论告知我们。

I encounter that kind of problem some time and again, too. 我也一次又一次遇到这种问题。 Try deleting the file. 尝试删除文件。 If the browser still shows "Hello world", I know of these reasons: 如果浏览器仍然显示“ Hello world”,则说明这些原因:

  1. You saved into a local directory instead of into the WAMPP directory. 您保存到本地目录,而不是WAMPP目录。 Eg sometimes I open a file from WebDAV and accidentially save it to the temp folder where it was downloaded to. 例如,有时我从WebDAV中打开一个文件,无意中将其保存到下载该文件的temp文件夹中。
  2. Your browser is looking at another directory / file than the one you're saving to. 您的浏览器正在查找的目录/文件不同于您要保存的目录/文件。
  3. Some serious caching is happening in your connection from editor - filesystem - WAMPP - browser. 从编辑器-文件系统-WAMPP-浏览器的连接中发生了一些严重的缓存。 This would disqualify your system for coding php, if you can't get rid of the caching. 如果您无法摆脱缓存,这将使您的系统无法进行php编码。

Hope my (negative) experiences bring a positive result for you. 希望我的(负面)经历能为您带来积极的结果。 ;) ;)

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

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