I wanted to deal with PHP. Download the tutorial. Posted code:

<html> <title><? print "Hello world!"; ?></title> </html> 

In Mozilla gives the title <? print "Hello world!"; ?> <? print "Hello world!"; ?> <? print "Hello world!"; ?> but you need " Hello world! ". Does not see PHP. Further read that PHP server language, and it is necessary to "turn on" the server. HAMR downloaded, but it did not start. I downloaded Denver, installed Denver, PHP on Denver, it works but nothing happens when I turn it on.

What to do?

  • one
    start reading manuals carefully + on the Denver website there are many help sections. - Artem
  • Maybe just the server is configured to support short php tags. Try instead of <? do <?php - ivkremer

4 answers 4

Try writing PHP code in a file with the extension * .php - everything will turn out!

  • With the extension *.php and htm l does not work, it seems to me that it should work in html too, that's not the point. - Sirius
  • You did not forget to start the Apache? - AseN
  • HZ, launched - Sirius

You can train in PHP without a web server. For this, it is enough (using Linux as an example) to call the code from

 #!/usr/bin/php <?php var_dump($argv); ?> 

and launch for execution

 chmod +x test && ./test 

If the script is launched from under the web server, then you need to make sure that

  1. web server with php support running
  2. the script is where it should be (web server root folder)
  3. the correct page is open in the browser ( http://127.0.0.1/hello.php , etc.)
  • point 2 and 3 not executed) - Sirius

The file must be .php

    Indeed, with the HTML extension this option does not work, with the PHP extension it works!