Google App Engine PHP dev local - HTML 文档的字符编码尚未声明

Google App Engine PHP dev local - The character encoding of the HTML document has not been declared

我是 App Engine 的新手 PHP。 我在 ubuntu 16.04 和 Google Cloud SDK 187.0.0 中工作。我正在学习本教程 https://cloud.google.com/appengine/docs/standard/php/quickstart

我的代码是:

app.yaml

runtime: php55
api_version: 1

handlers:
- url: /.*
  script: index.php 

index.php

<?php
    echo 'Hola Mundo PHP en APPENGINE - STANDAR ENVIROMENT';
?>

但是,当我想要 运行 Appengine server dev local 并且我打开 Mozilla 浏览器时显示一条消息。

"La codificación de caracteres del documento HTML no ha sido declarada. El documento se mostrará con texto "basura"en algunas configuraciones de navegador si el documento contiene caracteres externos al rango US-ASCII。La codificación de caracteres de la página debe ser declarada en el documento o en el protocol de transferencia。"

"The character encoding of the HTML document has not been declared. The document will be displayed with "如果文档包含 US-ASCII 范围之外的字符,某些浏览器设置中的垃圾“文本。页面的字符编码必须在文档或传输协议中声明。”。 =17=]

我已经在 Whosebug 中搜索了所有解决方案,但 none 有效。请帮助我。

附加,我看到 php 版本没有显示。

app-engine-php version doesn't show

这不是 App Engine 的问题,而是 HTML。如果您在页面上声明编码,消息应该消失:

<!DOCTYPE html>

<head>
    <title>my page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="encoding" content="utf-8" />
</head>

<body>
    Can You see this? If so, something wrong in your php.
    <?php
        echo 'Hola Mundo PHP en APPENGINE - STANDARD ENVIROMENT';
    ?>
</body>
</html>

UPDATE 此代码应该有效。我能想到的唯一另一个问题是你有一些性格问题。有时,当您 copy/paste 编码时,字符与显示的不同。特别是 ", ', ` , ´, ˝, ‘, “, ?, ¿。重新输入整个 PHP 语句。或者 copy/paste 直接从教程的代码中输入。

社区一切都是我的错。 PHP 代码很好。但是 运行 dev_appserver.py 的命令是错误的。

我的旧 dev_appserver.py 命令(错误):

dev_appserver.py --php_executable_path=/usr/bin/php5.6 --port=8099

我的新 dev_appserver.py 命令c(好):

dev_appserver.py --php_executable_path=/usr/bin/php-cgi5.6 --port=8099

我也安装 php5.6-cgi: apt install php5.6-cgi

按照本教程进行安装 php5.6 http://www.ingdiaz.org/cambiar-version-php-7-0-php-5-6-ubuntu-16-04/