2

I'm receiving this error when trying to deploy locally using Google App Engines's sdk (PHP 7)

dev_appserver.py app.yaml 

Returns

WARNING: The Cloud SDK no longer ships runtimes for PHP 5.4.  Please set your runtime to be "php55".

This is my .yaml file

runtime: php
env: flex

runtime_config:
  document_root: public

# Ensure we skip ".env", which is only for local development
skip_files:
  - .env

env_variables:
  # Put production environment variables here.
  APP_LOG: errorlog
  APP_KEY: :XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  STORAGE_DIR: /tmp 

It works fine using PHP 5+

runtime: php55
api_version: 1

My sdk components are up to date.

I'm not finding anyone having this issue. Wondering if I should just re-install the sdk.

btaylor507
  • 211
  • 1
  • 13

2 Answers2

3

dev_appserver.py does not run in the App Engine flexible environment.

From the standard environment Running the local development server:

Note: dev_appserver.py does not run in the App Engine flexible environment.

From the flex environment Running locally:

You run your application locally with the native development tools that you usually use.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
btaylor507
  • 211
  • 1
  • 13
  • Excellent point, I missed the `env: flex`. Well, from several SO questions apparently the dev server doesn't mind it and attempts to run anyways. With unexpected results, of course, since it still emulates only the standard environment :) – Dan Cornilescu Mar 10 '18 at 03:16
  • Related: https://stackoverflow.com/questions/45842772/how-to-tell-if-a-google-app-engine-documentation-page-applies-to-the-standard-or – Dan Cornilescu Mar 10 '18 at 03:29
1

The php option is probably still around for backward compatibility since 5.4 used to be supported. Use php55.

From the August 14, 2015 - Version 1.9.25 Release notes:

  • Development server no longer supports the "php" runtime. This will result in a Runtime Error. Please use "php55" instead.

And from the app.yaml Syntax table:

runtime

Required. The name of the App Engine runtime environment used by this application. To specify PHP, use php55.

runtime: php55

Update:

The above applies to the standard environment only, but since this is a flexible environment config @btaylor507's answer is better.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97