Home php PHP does not work "Hello World" on the local server

PHP does not work “Hello World” on the local server




PHP script is not inserted into HTML file.a So PHP works if the .php

Answer 1, Authority 100%

The default PHP in the HTML file is not executed, how to configure Read

Need to add to the file .htaccess or in Apache config such a string

# allow you to execute PHP in .htm and .html files
AddType Application / X-Httpd-Php .htm .html

After that, PHP will be performed in HTML files, which will lead to loss of performance, since all HTML files will be processed as a PHP code. Therefore, PHP code Place in .php templates.

and html tag in the last row of your code to change to the closing.

Answer 2

You incorrectly closed HTML tag, should be & lt; / HTML & GT;

Settings are ultimately taken to ensure that the HTML executes the PHP functions – because you need to send the file to the server to replace the PHP inserts with HTML designs.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions