0

我在 Mac 10.7.5 上运行时遇到以下错误

Running dev_appserver with the following flags:
    --skip_sdk_update_check=yes --port=8080 --admin_port=8888
Python command: /usr/bin/python2.7
INFO     2013-10-17 12:51:15,341 devappserver2.py:661] Skipping SDK update check.
WARNING  2013-10-17 12:51:15,350 api_server.py:332] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO     2013-10-17 12:51:15,359 api_server.py:139] Starting API server at: http://localhost:49520
INFO     2013-10-17 12:51:15,366 dispatcher.py:171] Starting module "default" running at: http://localhost:8080
INFO     2013-10-17 12:51:15,375 admin_server.py:117] Starting admin server at: http://localhost:8888
ERROR    2013-10-17 12:51:15,722 php_runtime.py:223] The PHP runtime is not available
Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 219, in new_instance
self._check_environment(php_executable_path)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 171, in _check_environment
version_stdout))
_PHPEnvironmentError: "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/php-cgi -v" returned an error [-11]

当我从 Google App Engine Launcher(版本 1.8.6)单击浏览时,我收到以下浏览器错误:

The PHP interpreter specified with the --php_executable_path flag ("/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/php-cgi") is not compatible with the App Engine PHP development environment.
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/php-cgi -v" returned an error [-11]

到目前为止我所做的:

  1. 重新安装 PHP 5.4
  2. 升级了 python 2.7.5(按照这些步骤

有人遇到同样的问题并解决了吗?

4

2 回答 2

1

此错误表示php-cgi您机器上运行的 SDK 附带的二进制文件存在问题。这是一个需要修复的错误。

但与此同时,您可以通过自己安装php-cgi(注意,这不是可执行文件)并使用标志php从开发服务器调用它来解决问题。--php_executable_path

安装 PHP 可执行文件的一种方法是通过 MacPorts:

sudo /opt/local/bin/port install php54-cgi php54-APC php54-calendar \
    php54-exif php54-gd php54-mysql php54-oauth php54-openssl php54-soap \
    php54-xdebug php54-xsl php54-mcrypt

安装后,php-cgi(PHP SDK 使用的二进制文件)可以在/opt/local/bin/php-cgi54. 然后,您可以使用以下命令将其与开发服务器一起使用:

google_appengine/dev_appserver.py --php_executable_path=/opt/local/bin/php-cgi54 .
于 2013-11-03T23:57:11.920 回答
0

我是带有 PHP 5.5 的 Ubuntu 14.04。我使用突触安装了 php-cgi 并得到了同样的错误。所以我对之前的答案做了一些小改动,它对我有用。

google_appengine/dev_appserver.py --php_executable_path=/usr/bin/php-cgi helloworld/

附言

利用

which php-cgi

定位 cgi 可执行文件

于 2014-05-14T02:18:17.787 回答