0

I am beginner in App Engine PHP. I am working in ubuntu 16.04 and Google Cloud SDK 187.0.0. I am following this tutorial https://cloud.google.com/appengine/docs/standard/php/quickstart

My code is:

app.yaml

runtime: php55
api_version: 1

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

index.php

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

However, when I want to run Appengine server dev local and I open Mozilla browser show a message.

"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 protocolo de transferencia."

"The character encoding of the HTML document has not been declared. The document will be displayed with "junk" text in some browser settings if the document contains characters external to the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol."

I have searched all the solutions in Stackoverflow but none works. Help me please.

Adicional, I see that the php version doesn't show.

app-engine-php version doesn't show

WH NM
  • 1
  • 3

2 Answers2

1

This is not an issue with App Engine, but HTML. If you declare the encoding on the page, the message should go away:

<!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 This code should work. The only other issue I can think of would be that you have some character issues. Sometimes when you copy/paste code, the character is different than it appears. Especially, ", ', ` , ´, ˝, ‘, “, ?, ¿. Retype that entire PHP statement. Or copy/paste it directly from the tutorial's code.

GAEfan
  • 11,244
  • 2
  • 17
  • 33
  • Your solution doesn't work. The message persist. I run the server with this command: dev_appserver.py --php_executable_path=/usr/bin/php5.6 --port=9999 app.yaml. I think that the problem is the google cloud sdk version. I don't know. – WH NM Feb 04 '18 at 05:27
  • **Community no solution work**. My problem persist. I apply that solution [solucion google groups](https://groups.google.com/forum/#!topic/google-appengine/9uT3RojOC0M) but **no work too**. use google cloud sdk 187.0.0 that is last release in ubuntu 16.04 64 bits Help me please. – WH NM Feb 06 '18 at 17:35
0

Community everything is my mistake. PHP code is good. However the command for running dev_appserver.py is bad.

My old dev_appserver.py command (bad):

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

My new dev_appserver.py commandc(good):

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

I install php5.6-cgi too: apt install php5.6-cgi

Follow this tutorial for install php5.6 http://www.ingdiaz.org/cambiar-version-php-7-0-php-5-6-ubuntu-16-04/

WH NM
  • 1
  • 3