2013-05-19 25 views
0

我對GAE完全陌生,我嘗試安裝並開始使用GAE PHP SDK。Google App Engine啓動錯誤:「C:/ Documents and Settings/userName/php」是一個目錄,需要一個yaml配置文件

我無法按照the very first Hello, World! example上的說明啓動服務器。

由於我是新的,我似乎無法弄清楚我哪裏出錯了。我得到了我一直在輸入的所有文件路徑和說明。

我正在使用Windows XP 32位。我已經安裝Python 2.7.5 as instructed (Installing the PHP SDK on Windows)。我提取了PHP和Google Appengine in c:\documents and settings\username\

這些都是我的文件路徑:

  • PHP:C:\documents and settings\userName\php
  • 谷歌應用程序引擎:c:\documents and settings\userName\google_appengine
  • HelloWorld的測試文件和YAML文件 「的app.yaml」:c:\documents and settings\userName\helloworld

在我輸入的命令行as instructed (in the very first Hello, World! example)

C:\Documents and Settings\userName> "google_appengine/dev_appserver.py" --php_executable_path = "C:/Documents and Settings/userName/php" helloworld/ 

,我得到以下錯誤:

google.appengine.tools.devappserver2.errors.InvalidAppConfigError: "C:/Documents and Settings/userName/php" is a directory and a yaml configuration file is required

回溯是(末尾包括錯誤):

File "C:\Documents and Settings\userName\google_appengine\dev_appserver.py", line 182, in run_file(file, globals())
File "C:\Documents and Settings\userName\google_appengine\dev_appserver.py", line 178, in _run_file execfile(script_path, globals)
File "C:\Documents and Settings\userName\google_appengine\google\appengine\tools\devappserver2\devappserver2.py", line 695, in main() File "C:\Documents and Settings\userName\google_appengine\google\appengine\tools\devappserver2\devappserver2.py", line 688, in main dev_server.start(options)
File "C:\Documents and Settings\userName\google_appengine\google\appengine\tools\devappserver2\devappserver2.py", line 525, in start options.yaml_files)
File "C:\Documents and Settings\userName\google_appengine\google\appengine\tools\devappserver2\application_configuration.py", line 541, in init yaml_path)
google.appengine.tools.devappserver2.errors.InvalidAppConfigError: "C:/Documents and Settings/userName/php" is a directory and a yaml configuration file is required

回答

3

參數--php_executable_path應該是路徑的php-cgi的二進制文件,不它駐留在文件夾

0

Please do as you have been instructed in the section Testing the Application

google_appengine/dev_appserver.py --php_executable_path=<path to php-cgi> helloworld/ 

看來你正在尋找理解在這種情況下<path to php-cgi>的含義。你顯然是通過一個目錄來嘗試這個,但是,這是PHP二進制文件的路徑,也就是可執行文件。

在Windows上,這通常稱爲程序。因此,您需要將路徑指向php-cgi程序,而不是指向php-cgi目錄的路徑。

對於您的錯誤消息的進一步理解,以及如何解決它:

你可能也在尋找理解在那裏你可以檢索的錯誤消息:

它是在堆棧跟蹤結束在Python:

google.appengine.tools.devappserver2.errors.InvalidAppConfigError: "C:/Documents and Settings/userName/php" is a directory and a yaml configuration file is required

如果你看的仔細,你可以看到下面的文字逐字:

"C:/Documents and Settings/userName/php" is a directory and a yaml configuration file is required

所以你已經通過一個目錄而不是helloworld/不包含包含yaml文件。即"C:/Documents and Settings/userName/php"

你明顯想要使用該目錄來執行PHP可執行路徑 - 正如前面已經概述的那樣 - 有點不對,需要二進制文件。然而,它顯然沒有被設置,因爲你不明白你不能在命令行中引入你認爲可以自由運行的空間。

要使錯誤消失,您需要確實按照指示,它們已被寫下來是有原因的。所以:

  • 不要在指示沒有的地方寫空格。命令行上的空間通常具有特殊的含義。
  • 仔細閱讀錯誤信息並首先了解它們。
  • 路徑可以是一個目錄,也可以是一個文件。
  • 使用二進制文件的路徑而不是使用包含二進制文件的目錄的路徑。
C:\Documents and Settings\userName> "google_appengine/dev_appserver.py" --php_executable_path="C:/Documents and Settings/userName/php/php-cgi.exe" helloworld/