Hi everybody and thank you for reading ?
I have a problem running a very simple php page including html content. I can get phpinfo() and echo() pointless “hello world” but as I try to run the following script I got from a tutorial :
<?xml version=”1.0″ encoding=”utf-8″?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “
<html xmlns=”
<head>
<title>Hello World!</title>
<meta content=”text/html;charset=utf-8″ http-equiv=”Content-Type”>
<meta content=”utf-8″ http-equiv=”encoding”>
</head>
<body>
<?php
echo htmlentities(‘hi world’, ENT_QUOTES, ‘utf-8’);
?>
</body>
</html>
I get the same error message over and over :
“GET [url]http://localhost/hello3.php
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.”
I am running it with Iceweasel (which is almost exactly the same as firefox as far as I know) and with apache2 on a debian (linux). It is in the right folder (/var/www) and if I remove the HTML headers and all the stuff, a echo() works. The “HTML stuff” seems to be the source of the problem but I can’t understand why.
Please if someone understands what is going on here I would be glad to get some help.