【问题标题】:Google cloud dev_appserver.py unable to host laravel project locally谷歌云 dev_appserver.py 无法在本地托管 laravel 项目
【发布时间】:2017-07-16 19:44:52
【问题描述】:

我正在运行 Laravel 5.4 项目,并托管在谷歌云项目下。为了测试我使用了dev_appserver.py app.yaml --runtime=php55的相同,它启动了程序,但它抛出了显示的错误

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

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

我无法弄清楚什么是“PLAEHOLDER”以及如何解决错误,以便可以在本地托管以下 laravel 项目以进行开发阶段。

TIA

【问题讨论】:

  • 仍然可以阅读被涂黑的部分文本。您可能想删除图片。

标签: php laravel google-app-engine gcloud google-cloud-sdk


【解决方案1】:

您正在尝试使用从标准环境到灵活环境应用的本地测试方法。本地开发服务器不支持灵活的应用程序 - 因此出现错误。

来自The PHP Development Server

注意:dev_appserver.py 不在 App Engine 柔性环境中运行。

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

这是您需要关注的文档:Running locally

【讨论】:

  • 他们在本地运行 flex 的唯一指南?这个句子? “要在部署之前测试您的应用程序的功能,请使用您通常使用的开发工具在本地环境中运行您的应用程序。”
【解决方案2】:

我在使用一些配置设置时遇到了同样的错误。

我的 app.yaml 文件与 php 运行时一起使用:

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

我无法获得使用 php 的标准环境,如果有人可以,请告诉我们如何:)

【讨论】:

  • 这不是真正的答案。这将更适合作为对原始问题的评论。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-08-26
  • 2020-01-11
  • 2020-10-27
  • 2020-12-12
  • 1970-01-01
  • 1970-01-01
  • 2021-09-11
相关资源
最近更新 更多