简体   繁体   中英

My PHP file/browser just frozed

Okay i'm just starting out on PHP & i'm doing the tutorials on the PHP manuals. After doing the first part.. which is echo hello world!, my browser just frozed? I refresh and all it says is Hello World! Even if I echo another word. Why doesn't it change?

and i'm also using Wamp for my PHP.

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"; ?> 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"

If you are using WAMP then, please check that you have made proper settings in those. Like,

  1. Have you marked short tags open in the wamp configuration?
  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.
  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. & 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:

  1. You saved into a local directory instead of into the WAMPP directory. Eg sometimes I open a file from WebDAV and accidentially save it to the temp folder where it was downloaded to.
  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. This would disqualify your system for coding php, if you can't get rid of the caching.

Hope my (negative) experiences bring a positive result for you. ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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