无法使用dev_appserver.py在mac上运行本地开发服务器

时间:2016-10-22 22:26:58

标签: php command-line terminal google-cloud-platform localserver

我正在关注Google云平台上的教程,为hello-world应用程序运行本地服务器,然后使用dev_appserver.py命令终端抱怨如下消息:

$ dev_appserver.py .
INFO     2016-10-22 21:59:53,084 devappserver2.py:769] Skipping SDK update check.
INFO     2016-10-22 21:59:53,129 api_server.py:205] Starting API server at: http://localhost:56857
INFO     2016-10-22 21:59:53,133 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO     2016-10-22 21:59:53,137 admin_server.py:116] Starting admin server at: http://localhost:8000
ERROR    2016-10-22 21:59:54,141 php_runtime.py:348] The PHP runtime is not available
Traceback (most recent call last):
  File "/Users/Dale/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 344, in new_instance
    self._check_binaries(php_executable_path, gae_extension_path)
  File "/Users/Dale/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 265, in _check_binaries
    raise _PHPBinaryError('The development server must be started with the '
_PHPBinaryError: The development server must be started with the --php_executable_path flag set to the path of the php-cgi binary.

抱怨是什么意思? php_runtime.py有什么问题吗?我该如何直接设置?非常感谢你。

1 个答案:

答案 0 :(得分:0)

如果您使用的是Mac,则需要运行以下命令:

gcloud组件安装app-engine-php-darwin

如果您使用的是Linux,则需要提供--php_executable_path作为错误消息说明。