Google cloud dev_appserver.py unable to host larav

2019-07-15 04:58发布

I'm running Laravel 5.4 project, and hosted under google cloud project. In order to test the same I have used dev_appserver.py app.yaml --runtime=php55 it initiates the program but it throws the error displayed

Warning: require(/Users/Avi/Documents/.../website/PLACEHOLDER): failed to open stream: No such file or directory in /Users/Avi/Downloads/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/php/setup.php on line 147

Fatal error: require(): Failed opening required '/Users/Avi/Documents/.../website/PLACEHOLDER' (include_path='.:/Users/Avi/Documents/.../website:/Users/Avi/Downloads/google-cloud-sdk/platform/google_appengine/php/sdk') in /Users/Avi/Downloads/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/php/setup.php on line 147

enter image description here

App.yaml

  runtime: custom
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: base64:...
  STORAGE_DIR: /tmp
  CACHE_DRIVER: file
  SESSION_DRIVER: file

I'm not able to figure out what's "PLAEHOLDER" and how to resolve the error so that the following laravel project can be hosted locally for development phase.

TIA

2条回答
【Aperson】
2楼-- · 2019-07-15 05:19

I encountered the same error with some config settings I used.

my app.yaml file worked with php runtime:

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: your_key
  STORAGE_DIR: /tmp

I couldn't get the standard environment to work with php, if anyone can, show us how :)

查看更多
疯言疯语
3楼-- · 2019-07-15 05:34

You are trying to use the local testing methodology from the standard environment to your flexible environment app. The local devserver doesn't support flexible apps - hence the error.

From The PHP Development Server:

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

Related: How to tell if a Google App Engine documentation page applies to the standard or the flexible environment

This is the doc you need to follow: Running locally.

查看更多
登录 后发表回答