PhpPathError:对于php72,必须在Google App Engine项目中指定--php_executable_path

时间:2019-10-11 23:27:58

标签: google-app-engine gcloud php-7.2

我正在本地环境(Windows 10)中运行google cloud sdk,并将应用程序部署到云项目中。我可以运行php55项目,但是当我尝试运行php72项目时,出现以下错误。

INFO     2019-10-12 09:22:00,588 devappserver2.py:278] Skipping SDK update check.
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\dev_appserver.py", line 96, in <module>
    _run_file(__file__, globals())

  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\dev_appserver.py", line 90, in _run_file
    execfile(_PATHS.script_file(script_name), globals_)

  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\devappserver2\devappserver2.py", line 600, in <module>
    main()

  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\devappserver2\devappserver2.py", line 588, in main   dev_server.start(options)

  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\devappserver2\devappserver2.py", line 301, in start
    raise PhpPathError('For php72, --php_executable_path must be specified.')
__main__.PhpPathError: For php72, --php_executable_path must be specified.

在app.yaml中:

runtime: php72

1 个答案:

答案 0 :(得分:0)

您似乎正在使用dev_appserver.py在本地运行项目,但是根据Google App Engine documentation here,您不能在PHP7中使用dev_appserver.py

具体说:

  

dev_appserver.py不支持   PHP 7.2和PHP 7.3运行时。测试您的应用程序并   在本地运行它,您必须下载并安装PHP 7.2或PHP 7.3以及   设置网络服务器。

     

例如,通过运行以下命令来启动HTTP服务器:

     

php -S localhost:8080

     

然后,在Web浏览器中查看您的应用程序   在http://localhost:8080