First you need to understand...
What is the difference between a PHP web page and HTML?
PHP files are similar to HTML files, but may include HTML and PHP code. The PHP code is parsed (or executed) by the web server when the page is accessed and the resulting output is saved as HTML on the web page. When a user accesses a PHP page, their web browser only receives the HTML code, as the web server has processed the PHP code in the background. Most PHP pages are processed so quickly that it does not significantly decrease the loading of the web page.
The . php extension is important as it informs the web server that the page can include PHP code. Therefore, it must be run through the server’s PHP engine before it is sent to a client’s web browser. This allows dynamic content to be generated every time the web page is loaded, based on the variables included in the PHP code. For example, PHP pages can load objects, such as the current date and time, form field data sent by a user, or database information. Still, when the page reaches the user’s web browser, everything is formatted as HTML.
Knowing this you should realize that your extension is . html and not . php, so the first thing to do is to change it. Then you need to understand the basic structure of HTML:
<!DOCTYPE html>
<html>
<head>
<title>Titulo</title>
</head>
<body>
<h1>Cabeçalho</h1>
<p>Parágrafo</p>
</body>
</html>
That is, another error is in your structural organization of HTML.
And last but not least, the ; at the end of echo that every php command should count when finished.
<!DOCTYPE html>
<html>
<head>
<title>
<?php echo 'Rodrigo'; ?>
</title>
</head>
<body>
</body>
</html>
Any error message ?
– Edvaldo Lucena
No, in the title of the page appears the following: <?php echo 'Rodrigo' ?>
– SFDKO
your file is . php? Because the code is being displayed instead of compiled
– Leonardo Negrão
Why
<title><?php echo 'Rodrigo' ?></title>
and not<title>Rodrigo</title>
? If you will not use variable, I do not understand the reason.– rbz